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; break;
} }
case Instruction::NEG: /*case Instruction::NEG:
{ {
auto top = stack.pop(); auto top = stack.pop();
auto zero = Constant::get(0); auto zero = Constant::get(0);
auto res = m_builder.CreateSub(zero, top); auto res = m_builder.CreateSub(zero, top);
stack.push(res); stack.push(res);
break; break;
} }*/
case Instruction::LT: 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 initSize = static_cast<size_t>(llvm2eth(*_initSize));
auto&& initRef = bytesConstRef(_rt->getMemory().data() + initOff, initSize); auto&& initRef = bytesConstRef(_rt->getMemory().data() + initOff, initSize);
OnOpFunc onOp{}; // TODO: Handle that thing 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; *_address = address;
} }
else else

4
libevmjit/GasMeter.cpp

@ -31,7 +31,7 @@ uint64_t getStepCost(Instruction inst) // TODO: Add this function to FeeSructure
return 0; return 0;
case Instruction::SSTORE: case Instruction::SSTORE:
return static_cast<uint64_t>(c_sstoreGas); return static_cast<uint64_t>(c_sstoreResetGas); // FIXME: Check store gas
case Instruction::SLOAD: case Instruction::SLOAD:
return static_cast<uint64_t>(c_sloadGas); 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 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 // [ADD] if oldValue == 0 and newValue != 0 => 2*cost
// [DEL] if oldValue != 0 and newValue == 0 => 0 // [DEL] if oldValue != 0 and newValue == 0 => 0

Loading…
Cancel
Save