From c7ba567f9ae516efcc6eaa9171e3fee95b121cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 28 Oct 2014 12:26:45 +0100 Subject: [PATCH] Merge branch 'develop' into develop-evmcc Conflicts: libevm/ExtVMFace.h libevm/VM.h test/vm.cpp test/vm.h windows/LibEthereum.vcxproj.filters --- libevmjit/Compiler.cpp | 4 ++-- libevmjit/Ext.cpp | 2 +- libevmjit/GasMeter.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libevmjit/Compiler.cpp b/libevmjit/Compiler.cpp index 17d1decc22..0b9fb5b7b1 100644 --- a/libevmjit/Compiler.cpp +++ b/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: { diff --git a/libevmjit/Ext.cpp b/libevmjit/Ext.cpp index 003b0ae087..34c1ebf5e4 100644 --- a/libevmjit/Ext.cpp +++ b/libevmjit/Ext.cpp @@ -227,7 +227,7 @@ EXPORT void ext_create(Runtime* _rt, i256* _endowment, i256* _initOff, i256* _in auto initSize = static_cast(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 diff --git a/libevmjit/GasMeter.cpp b/libevmjit/GasMeter.cpp index 897044cbeb..b71fd82865 100644 --- a/libevmjit/GasMeter.cpp +++ b/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(c_sstoreGas); + return static_cast(c_sstoreResetGas); // FIXME: Check store gas case Instruction::SLOAD: return static_cast(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(c_sstoreGas); + static const auto sstoreCost = static_cast(c_sstoreResetGas); // FIXME: Check store gas // [ADD] if oldValue == 0 and newValue != 0 => 2*cost // [DEL] if oldValue != 0 and newValue == 0 => 0