aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorGav Wood <g@ethdev.com>2015-11-23 19:42:28 +0800
committerGav Wood <g@ethdev.com>2015-11-23 19:42:28 +0800
commit2554d6104a491e586ecad9cf7fe31949dc46e968 (patch)
tree3a3639713c76c95f33f432bb00bbba2842682557 /libsolidity/codegen
parent58110b27c14962b6a46bc3b09e8ea1a75a4087e7 (diff)
parentbff172cf656843dd0f05def1f920be3d98df9640 (diff)
downloaddexon-solidity-2554d6104a491e586ecad9cf7fe31949dc46e968.tar.gz
dexon-solidity-2554d6104a491e586ecad9cf7fe31949dc46e968.tar.zst
dexon-solidity-2554d6104a491e586ecad9cf7fe31949dc46e968.zip
Merge pull request #236 from ethereum/hot_gav
Fix up for new API from EIP-1.1.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r--libsolidity/codegen/Compiler.cpp6
-rw-r--r--libsolidity/codegen/CompilerUtils.cpp1
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp12
3 files changed, 10 insertions, 9 deletions
diff --git a/libsolidity/codegen/Compiler.cpp b/libsolidity/codegen/Compiler.cpp
index 5daa37de..055e607f 100644
--- a/libsolidity/codegen/Compiler.cpp
+++ b/libsolidity/codegen/Compiler.cpp
@@ -24,12 +24,11 @@
#include <algorithm>
#include <boost/range/adaptor/reversed.hpp>
#include <libevmcore/Instruction.h>
+#include <libethcore/ChainOperationParams.h>
#include <libevmasm/Assembly.h>
-#include <libevmcore/Params.h>
#include <libsolidity/ast/AST.h>
#include <libsolidity/codegen/ExpressionCompiler.h>
#include <libsolidity/codegen/CompilerUtils.h>
-
using namespace std;
using namespace dev;
using namespace dev::solidity;
@@ -760,6 +759,7 @@ void Compiler::compileExpression(Expression const& _expression, TypePointer cons
eth::Assembly Compiler::cloneRuntime()
{
+ eth::EVMSchedule schedule;
eth::Assembly a;
a << eth::Instruction::CALLDATASIZE;
a << u256(0) << eth::Instruction::DUP1 << eth::Instruction::CALLDATACOPY;
@@ -771,7 +771,7 @@ eth::Assembly Compiler::cloneRuntime()
// this is the address which has to be substituted by the linker.
//@todo implement as special "marker" AssemblyItem.
a << u256("0xcafecafecafecafecafecafecafecafecafecafe");
- a << u256(eth::c_callGas + eth::c_callValueTransferGas + 10) << eth::Instruction::GAS << eth::Instruction::SUB;
+ a << u256(schedule.callGas + schedule.callValueTransferGas + 10) << eth::Instruction::GAS << eth::Instruction::SUB;
a << eth::Instruction::CALLCODE;
//Propagate error condition (if CALLCODE pushes 0 on stack).
a << eth::Instruction::ISZERO;
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp
index 6d82e94b..ce20f2d1 100644
--- a/libsolidity/codegen/CompilerUtils.cpp
+++ b/libsolidity/codegen/CompilerUtils.cpp
@@ -23,7 +23,6 @@
#include <libsolidity/codegen/CompilerUtils.h>
#include <libsolidity/ast/AST.h>
#include <libevmcore/Instruction.h>
-#include <libevmcore/Params.h>
#include <libsolidity/codegen/ArrayUtils.h>
#include <libsolidity/codegen/LValue.h>
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 0f952f9c..05d9ea1c 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -23,17 +23,18 @@
#include <utility>
#include <numeric>
#include <boost/range/adaptor/reversed.hpp>
-#include <libevmcore/Params.h>
#include <libdevcore/Common.h>
#include <libdevcore/SHA3.h>
+#include <libethcore/ChainOperationParams.h>
#include <libsolidity/ast/AST.h>
#include <libsolidity/codegen/ExpressionCompiler.h>
#include <libsolidity/codegen/CompilerContext.h>
#include <libsolidity/codegen/CompilerUtils.h>
#include <libsolidity/codegen/LValue.h>
-
using namespace std;
+// TODO: FIXME: HOMESTEAD: XXX: @chriseth Params deprecated - use EVMSchedule instead.
+
namespace dev
{
namespace solidity
@@ -1195,6 +1196,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
vector<ASTPointer<Expression const>> const& _arguments
)
{
+ eth::EVMSchedule schedule;// TODO: Make relevant to current suppose context.
solAssert(
_functionType.takesArbitraryParameters() ||
_arguments.size() == _functionType.parameterTypes().size(), ""
@@ -1303,11 +1305,11 @@ void ExpressionCompiler::appendExternalFunctionCall(
{
// send all gas except the amount needed to execute "SUB" and "CALL"
// @todo this retains too much gas for now, needs to be fine-tuned.
- u256 gasNeededByCaller = eth::c_callGas + 10;
+ u256 gasNeededByCaller = schedule.callGas + 10;
if (_functionType.valueSet())
- gasNeededByCaller += eth::c_callValueTransferGas;
+ gasNeededByCaller += schedule.callValueTransferGas;
if (!isCallCode)
- gasNeededByCaller += eth::c_callNewAccountGas; // we never know
+ gasNeededByCaller += schedule.callNewAccountGas; // we never know
m_context <<
gasNeededByCaller <<
eth::Instruction::GAS <<