aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm/ConstantOptimiser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libevmasm/ConstantOptimiser.cpp')
-rw-r--r--libevmasm/ConstantOptimiser.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libevmasm/ConstantOptimiser.cpp b/libevmasm/ConstantOptimiser.cpp
index 2ecbfa7f..a7a87c35 100644
--- a/libevmasm/ConstantOptimiser.cpp
+++ b/libevmasm/ConstantOptimiser.cpp
@@ -124,7 +124,7 @@ void ConstantOptimisationMethod::replaceConstants(
_items = std::move(replaced);
}
-bigint LiteralMethod::gasNeeded()
+bigint LiteralMethod::gasNeeded() const
{
return combineGas(
simpleRunGas({Instruction::PUSH1}),
@@ -139,7 +139,7 @@ CodeCopyMethod::CodeCopyMethod(Params const& _params, u256 const& _value):
{
}
-bigint CodeCopyMethod::gasNeeded()
+bigint CodeCopyMethod::gasNeeded() const
{
return combineGas(
// Run gas: we ignore memory increase costs
@@ -151,7 +151,7 @@ bigint CodeCopyMethod::gasNeeded()
);
}
-AssemblyItems CodeCopyMethod::execute(Assembly& _assembly)
+AssemblyItems CodeCopyMethod::execute(Assembly& _assembly) const
{
bytes data = toBigEndian(m_value);
AssemblyItems actualCopyRoutine = copyRoutine();
@@ -234,7 +234,7 @@ AssemblyItems ComputeMethod::findRepresentation(u256 const& _value)
}
}
-bool ComputeMethod::checkRepresentation(u256 const& _value, AssemblyItems const& _routine)
+bool ComputeMethod::checkRepresentation(u256 const& _value, AssemblyItems const& _routine) const
{
// This is a tiny EVM that can only evaluate some instructions.
vector<u256> stack;
@@ -282,7 +282,7 @@ bool ComputeMethod::checkRepresentation(u256 const& _value, AssemblyItems const&
return stack.size() == 1 && stack.front() == _value;
}
-bigint ComputeMethod::gasNeeded(AssemblyItems const& _routine)
+bigint ComputeMethod::gasNeeded(AssemblyItems const& _routine) const
{
size_t numExps = count(_routine.begin(), _routine.end(), Instruction::EXP);
return combineGas(