mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Drop support for evm15 and eip-615.
This commit is contained in:
@@ -65,7 +65,6 @@ void EVMAssembly::appendLabel(LabelID _labelId)
|
||||
|
||||
void EVMAssembly::appendLabelReference(LabelID _labelId)
|
||||
{
|
||||
yulAssert(!m_evm15, "Cannot use plain label references in EMV1.5 mode.");
|
||||
// @TODO we now always use labelReferenceSize for all labels, it could be shortened
|
||||
// for some of them.
|
||||
appendInstruction(evmasm::pushInstruction(labelReferenceSize));
|
||||
@@ -94,65 +93,20 @@ void EVMAssembly::appendLinkerSymbol(string const&)
|
||||
|
||||
void EVMAssembly::appendJump(int _stackDiffAfter, JumpType)
|
||||
{
|
||||
yulAssert(!m_evm15, "Plain JUMP used for EVM 1.5");
|
||||
appendInstruction(evmasm::Instruction::JUMP);
|
||||
m_stackHeight += _stackDiffAfter;
|
||||
}
|
||||
|
||||
void EVMAssembly::appendJumpTo(LabelID _labelId, int _stackDiffAfter, JumpType _jumpType)
|
||||
{
|
||||
if (m_evm15)
|
||||
{
|
||||
m_bytecode.push_back(uint8_t(evmasm::Instruction::EIP615_JUMPTO));
|
||||
appendLabelReferenceInternal(_labelId);
|
||||
m_stackHeight += _stackDiffAfter;
|
||||
}
|
||||
else
|
||||
{
|
||||
appendLabelReference(_labelId);
|
||||
appendJump(_stackDiffAfter, _jumpType);
|
||||
}
|
||||
appendLabelReference(_labelId);
|
||||
appendJump(_stackDiffAfter, _jumpType);
|
||||
}
|
||||
|
||||
void EVMAssembly::appendJumpToIf(LabelID _labelId, JumpType)
|
||||
{
|
||||
if (m_evm15)
|
||||
{
|
||||
m_bytecode.push_back(uint8_t(evmasm::Instruction::EIP615_JUMPIF));
|
||||
appendLabelReferenceInternal(_labelId);
|
||||
m_stackHeight--;
|
||||
}
|
||||
else
|
||||
{
|
||||
appendLabelReference(_labelId);
|
||||
appendInstruction(evmasm::Instruction::JUMPI);
|
||||
}
|
||||
}
|
||||
|
||||
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::EIP615_BEGINSUB));
|
||||
m_stackHeight += _arguments;
|
||||
}
|
||||
|
||||
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::EIP615_JUMPSUB));
|
||||
appendLabelReferenceInternal(_labelId);
|
||||
m_stackHeight += _returns - _arguments;
|
||||
}
|
||||
|
||||
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::EIP615_RETURNSUB));
|
||||
m_stackHeight += _stackDiffAfter - _returns;
|
||||
appendLabelReference(_labelId);
|
||||
appendInstruction(evmasm::Instruction::JUMPI);
|
||||
}
|
||||
|
||||
evmasm::LinkerObject EVMAssembly::finalize()
|
||||
|
||||
Reference in New Issue
Block a user