|
@ -52,6 +52,8 @@ static array<InstructionMetric, 256> metrics() |
|
|
|
|
|
|
|
|
bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) |
|
|
bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) |
|
|
{ |
|
|
{ |
|
|
|
|
|
m_stack.reserve((unsigned)c_stackLimit); |
|
|
|
|
|
|
|
|
static const array<InstructionMetric, 256> c_metrics = metrics(); |
|
|
static const array<InstructionMetric, 256> c_metrics = metrics(); |
|
|
|
|
|
|
|
|
auto memNeed = [](u256 _offset, dev::u256 _size) { return _size ? (bigint)_offset + _size : (bigint)0; }; |
|
|
auto memNeed = [](u256 _offset, dev::u256 _size) { return _size ? (bigint)_offset + _size : (bigint)0; }; |
|
@ -183,6 +185,40 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) |
|
|
runGas = c_expGas + c_expByteGas * (32 - (h256(expon).firstBitSet() / 8)); |
|
|
runGas = c_expGas + c_expByteGas * (32 - (h256(expon).firstBitSet() / 8)); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
case Instruction::PUSH1: |
|
|
|
|
|
case Instruction::PUSH2: |
|
|
|
|
|
case Instruction::PUSH3: |
|
|
|
|
|
case Instruction::PUSH4: |
|
|
|
|
|
case Instruction::PUSH5: |
|
|
|
|
|
case Instruction::PUSH6: |
|
|
|
|
|
case Instruction::PUSH7: |
|
|
|
|
|
case Instruction::PUSH8: |
|
|
|
|
|
case Instruction::PUSH9: |
|
|
|
|
|
case Instruction::PUSH10: |
|
|
|
|
|
case Instruction::PUSH11: |
|
|
|
|
|
case Instruction::PUSH12: |
|
|
|
|
|
case Instruction::PUSH13: |
|
|
|
|
|
case Instruction::PUSH14: |
|
|
|
|
|
case Instruction::PUSH15: |
|
|
|
|
|
case Instruction::PUSH16: |
|
|
|
|
|
case Instruction::PUSH17: |
|
|
|
|
|
case Instruction::PUSH18: |
|
|
|
|
|
case Instruction::PUSH19: |
|
|
|
|
|
case Instruction::PUSH20: |
|
|
|
|
|
case Instruction::PUSH21: |
|
|
|
|
|
case Instruction::PUSH22: |
|
|
|
|
|
case Instruction::PUSH23: |
|
|
|
|
|
case Instruction::PUSH24: |
|
|
|
|
|
case Instruction::PUSH25: |
|
|
|
|
|
case Instruction::PUSH26: |
|
|
|
|
|
case Instruction::PUSH27: |
|
|
|
|
|
case Instruction::PUSH28: |
|
|
|
|
|
case Instruction::PUSH29: |
|
|
|
|
|
case Instruction::PUSH30: |
|
|
|
|
|
case Instruction::PUSH31: |
|
|
|
|
|
case Instruction::PUSH32: |
|
|
|
|
|
if (m_stack.size() > c_stackLimit) |
|
|
|
|
|
BOOST_THROW_EXCEPTION(OutOfStack()); |
|
|
default:; |
|
|
default:; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|