Browse Source

Merge branch 'develop' into develop-evmcc

Conflicts:
	libevm/ExtVMFace.h
	libevm/VM.h
	test/vm.cpp
	test/vm.h
	windows/LibEthereum.vcxproj.filters
cl-refactor
Paweł Bylica 10 years ago
parent
commit
c7ba567f9a
  1. 4
      libevmjit/Compiler.cpp
  2. 2
      libevmjit/Ext.cpp
  3. 4
      libevmjit/GasMeter.cpp

4
libevmjit/Compiler.cpp

@ -369,14 +369,14 @@ void Compiler::compileBasicBlock(BasicBlock& basicBlock, bytesConstRef bytecode,
break;
}
case Instruction::NEG:
/*case Instruction::NEG:
{
auto top = stack.pop();
auto zero = Constant::get(0);
auto res = m_builder.CreateSub(zero, top);
stack.push(res);
break;
}
}*/
case Instruction::LT:
{

2
libevmjit/Ext.cpp

@ -227,7 +227,7 @@ EXPORT void ext_create(Runtime* _rt, i256* _endowment, i256* _initOff, i256* _in
auto initSize = static_cast<size_t>(llvm2eth(*_initSize));
auto&& initRef = bytesConstRef(_rt->getMemory().data() + initOff, initSize);
OnOpFunc onOp{}; // TODO: Handle that thing
h256 address = ext.create(endowment, &gas, initRef, onOp);
h256 address(ext.create(endowment, &gas, initRef, onOp), h256::AlignRight);
*_address = address;
}
else

4
libevmjit/GasMeter.cpp

@ -31,7 +31,7 @@ uint64_t getStepCost(Instruction inst) // TODO: Add this function to FeeSructure
return 0;
case Instruction::SSTORE:
return static_cast<uint64_t>(c_sstoreGas);
return static_cast<uint64_t>(c_sstoreResetGas); // FIXME: Check store gas
case Instruction::SLOAD:
return static_cast<uint64_t>(c_sloadGas);
@ -133,7 +133,7 @@ void GasMeter::countSStore(Ext& _ext, llvm::Value* _index, llvm::Value* _newValu
{
assert(!m_checkCall); // Everything should've been commited before
static const auto sstoreCost = static_cast<uint64_t>(c_sstoreGas);
static const auto sstoreCost = static_cast<uint64_t>(c_sstoreResetGas); // FIXME: Check store gas
// [ADD] if oldValue == 0 and newValue != 0 => 2*cost
// [DEL] if oldValue != 0 and newValue == 0 => 0

Loading…
Cancel
Save