Prefix EIP-615 opcodes with EIP615 in Instructions

This commit is contained in:
Alex Beregszaszi 2020-07-13 15:20:29 +01:00
parent 289fc7a9d0
commit 870ea98c21
3 changed files with 26 additions and 26 deletions

View File

@ -174,16 +174,16 @@ enum class Instruction: uint8_t
LOG3, ///< Makes a log entry; 3 topics.
LOG4, ///< Makes a log entry; 4 topics.
JUMPTO = 0xb0, ///< alter the program counter to a jumpdest -- not part of Instructions.cpp
JUMPIF, ///< conditionally alter the program counter -- not part of Instructions.cpp
JUMPV, ///< alter the program counter to a jumpdest -- not part of Instructions.cpp
JUMPSUB, ///< alter the program counter to a beginsub -- not part of Instructions.cpp
JUMPSUBV, ///< alter the program counter to a beginsub -- not part of Instructions.cpp
BEGINSUB, ///< set a potential jumpsub destination -- not part of Instructions.cpp
BEGINDATA, ///< begin the data section -- not part of Instructions.cpp
RETURNSUB, ///< return to subroutine jumped from -- not part of Instructions.cpp
PUTLOCAL, ///< pop top of stack to local variable -- not part of Instructions.cpp
GETLOCAL, ///< push local variable to top of stack -- not part of Instructions.cpp
EIP615_JUMPTO = 0xb0, ///< alter the program counter to a jumpdest -- not part of Instructions.cpp
EIP615_JUMPIF, ///< conditionally alter the program counter -- not part of Instructions.cpp
EIP615_JUMPV, ///< alter the program counter to a jumpdest -- not part of Instructions.cpp
EIP615_JUMPSUB, ///< alter the program counter to a beginsub -- not part of Instructions.cpp
EIP615_JUMPSUBV, ///< alter the program counter to a beginsub -- not part of Instructions.cpp
EIP615_BEGINSUB, ///< set a potential jumpsub destination -- not part of Instructions.cpp
EIP615_BEGINDATA, ///< begin the data section -- not part of Instructions.cpp
EIP615_RETURNSUB, ///< return to subroutine jumped from -- not part of Instructions.cpp
EIP615_PUTLOCAL, ///< pop top of stack to local variable -- not part of Instructions.cpp
EIP615_GETLOCAL, ///< push local variable to top of stack -- not part of Instructions.cpp
CREATE = 0xf0, ///< create a new account with associated code
CALL, ///< message-call into an account

View File

@ -102,7 +102,7 @@ void EVMAssembly::appendJumpTo(LabelID _labelId, int _stackDiffAfter, JumpType _
{
if (m_evm15)
{
m_bytecode.push_back(uint8_t(evmasm::Instruction::JUMPTO));
m_bytecode.push_back(uint8_t(evmasm::Instruction::EIP615_JUMPTO));
appendLabelReferenceInternal(_labelId);
m_stackHeight += _stackDiffAfter;
}
@ -117,7 +117,7 @@ void EVMAssembly::appendJumpToIf(LabelID _labelId, JumpType)
{
if (m_evm15)
{
m_bytecode.push_back(uint8_t(evmasm::Instruction::JUMPIF));
m_bytecode.push_back(uint8_t(evmasm::Instruction::EIP615_JUMPIF));
appendLabelReferenceInternal(_labelId);
m_stackHeight--;
}
@ -133,7 +133,7 @@ void EVMAssembly::appendBeginsub(LabelID _labelId, int _arguments)
yulAssert(m_evm15, "BEGINSUB used for EVM 1.0");
yulAssert(_arguments >= 0, "");
setLabelToCurrentPosition(_labelId);
m_bytecode.push_back(uint8_t(evmasm::Instruction::BEGINSUB));
m_bytecode.push_back(uint8_t(evmasm::Instruction::EIP615_BEGINSUB));
m_stackHeight += _arguments;
}
@ -141,7 +141,7 @@ void EVMAssembly::appendJumpsub(LabelID _labelId, int _arguments, int _returns)
{
yulAssert(m_evm15, "JUMPSUB used for EVM 1.0");
yulAssert(_arguments >= 0 && _returns >= 0, "");
m_bytecode.push_back(uint8_t(evmasm::Instruction::JUMPSUB));
m_bytecode.push_back(uint8_t(evmasm::Instruction::EIP615_JUMPSUB));
appendLabelReferenceInternal(_labelId);
m_stackHeight += _returns - _arguments;
}
@ -150,7 +150,7 @@ void EVMAssembly::appendReturnsub(int _returns, int _stackDiffAfter)
{
yulAssert(m_evm15, "RETURNSUB used for EVM 1.0");
yulAssert(_returns >= 0, "");
m_bytecode.push_back(uint8_t(evmasm::Instruction::RETURNSUB));
m_bytecode.push_back(uint8_t(evmasm::Instruction::EIP615_RETURNSUB));
m_stackHeight += _stackDiffAfter - _returns;
}

View File

@ -409,17 +409,17 @@ u256 EVMInstructionInterpreter::eval(
case Instruction::SWAP14:
case Instruction::SWAP15:
case Instruction::SWAP16:
// --------------- EVM 2.0 ---------------
case Instruction::JUMPTO:
case Instruction::JUMPIF:
case Instruction::JUMPV:
case Instruction::JUMPSUB:
case Instruction::JUMPSUBV:
case Instruction::BEGINSUB:
case Instruction::BEGINDATA:
case Instruction::RETURNSUB:
case Instruction::PUTLOCAL:
case Instruction::GETLOCAL:
// --------------- EIP-615 ---------------
case Instruction::EIP615_JUMPTO:
case Instruction::EIP615_JUMPIF:
case Instruction::EIP615_JUMPV:
case Instruction::EIP615_JUMPSUB:
case Instruction::EIP615_JUMPSUBV:
case Instruction::EIP615_BEGINSUB:
case Instruction::EIP615_BEGINDATA:
case Instruction::EIP615_RETURNSUB:
case Instruction::EIP615_PUTLOCAL:
case Instruction::EIP615_GETLOCAL:
{
yulAssert(false, "");
return 0;