mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11948 from ethereum/remove-assemblyitemtype-pushstring
Remove unused AssemblyItemType::PushString.
This commit is contained in:
commit
49cde9d47b
@ -250,10 +250,6 @@ Json::Value Assembly::assemblyJSON(map<string, unsigned> const& _sourceIndices)
|
||||
collection.append(
|
||||
createJsonValue("PUSH", sourceIndex, i.location().start, i.location().end, toStringInHex(i.data()), i.getJumpTypeAsString()));
|
||||
break;
|
||||
case PushString:
|
||||
collection.append(
|
||||
createJsonValue("PUSH tag", sourceIndex, i.location().start, i.location().end, m_strings.at(h256(i.data()))));
|
||||
break;
|
||||
case PushTag:
|
||||
if (i.data() == 0)
|
||||
collection.append(
|
||||
@ -621,19 +617,6 @@ LinkerObject const& Assembly::assemble() const
|
||||
case Operation:
|
||||
ret.bytecode.push_back(static_cast<uint8_t>(i.instruction()));
|
||||
break;
|
||||
case PushString:
|
||||
{
|
||||
ret.bytecode.push_back(static_cast<uint8_t>(Instruction::PUSH32));
|
||||
unsigned ii = 0;
|
||||
for (auto j: m_strings.at(h256(i.data())))
|
||||
if (++ii > 32)
|
||||
break;
|
||||
else
|
||||
ret.bytecode.push_back(uint8_t(j));
|
||||
while (ii++ < 32)
|
||||
ret.bytecode.push_back(0);
|
||||
break;
|
||||
}
|
||||
case Push:
|
||||
{
|
||||
unsigned b = max<unsigned>(1, util::bytesRequired(i.data()));
|
||||
|
@ -70,8 +70,6 @@ size_t AssemblyItem::bytesRequired(size_t _addressLength) const
|
||||
case Operation:
|
||||
case Tag: // 1 byte for the JUMPDEST
|
||||
return 1;
|
||||
case PushString:
|
||||
return 1 + 32;
|
||||
case Push:
|
||||
return 1 + max<size_t>(1, util::bytesRequired(data()));
|
||||
case PushSubSize:
|
||||
@ -118,7 +116,6 @@ size_t AssemblyItem::returnValues() const
|
||||
case Operation:
|
||||
return static_cast<size_t>(instructionInfo(instruction()).ret);
|
||||
case Push:
|
||||
case PushString:
|
||||
case PushTag:
|
||||
case PushData:
|
||||
case PushSub:
|
||||
@ -147,7 +144,6 @@ bool AssemblyItem::canBeFunctional() const
|
||||
case Operation:
|
||||
return !isDupInstruction(instruction()) && !isSwapInstruction(instruction());
|
||||
case Push:
|
||||
case PushString:
|
||||
case PushTag:
|
||||
case PushData:
|
||||
case PushSub:
|
||||
@ -195,9 +191,6 @@ string AssemblyItem::toAssemblyText(Assembly const& _assembly) const
|
||||
case Push:
|
||||
text = toHex(util::toCompactBigEndian(data(), 1), util::HexPrefix::Add);
|
||||
break;
|
||||
case PushString:
|
||||
text = string("data_") + util::toHex(data());
|
||||
break;
|
||||
case PushTag:
|
||||
{
|
||||
size_t sub{0};
|
||||
@ -276,9 +269,6 @@ ostream& solidity::evmasm::operator<<(ostream& _out, AssemblyItem const& _item)
|
||||
case Push:
|
||||
_out << " PUSH " << hex << _item.data() << dec;
|
||||
break;
|
||||
case PushString:
|
||||
_out << " PushString" << hex << (unsigned)_item.data() << dec;
|
||||
break;
|
||||
case PushTag:
|
||||
{
|
||||
size_t subId = _item.splitForeignPushTag().first;
|
||||
|
@ -38,7 +38,6 @@ enum AssemblyItemType
|
||||
UndefinedItem,
|
||||
Operation,
|
||||
Push,
|
||||
PushString,
|
||||
PushTag,
|
||||
PushSub,
|
||||
PushSubSize,
|
||||
|
@ -47,7 +47,6 @@ GasMeter::GasConsumption GasMeter::estimateMax(AssemblyItem const& _item, bool _
|
||||
case Push:
|
||||
case PushTag:
|
||||
case PushData:
|
||||
case PushString:
|
||||
case PushSub:
|
||||
case PushSubSize:
|
||||
case PushProgramSize:
|
||||
|
@ -112,7 +112,7 @@ struct PushPop: SimplePeepholeOptimizerMethod<PushPop, 2>
|
||||
auto t = _push.type();
|
||||
return _pop == Instruction::POP && (
|
||||
SemanticInformation::isDupInstruction(_push) ||
|
||||
t == Push || t == PushString || t == PushTag || t == PushSub ||
|
||||
t == Push || t == PushTag || t == PushSub ||
|
||||
t == PushSubSize || t == PushProgramSize || t == PushData || t == PushLibraryAddress
|
||||
);
|
||||
}
|
||||
|
@ -41,7 +41,6 @@ bool SemanticInformation::breaksCSEAnalysisBlock(AssemblyItem const& _item, bool
|
||||
case VerbatimBytecode:
|
||||
return true;
|
||||
case Push:
|
||||
case PushString:
|
||||
case PushTag:
|
||||
case PushSub:
|
||||
case PushSubSize:
|
||||
|
Loading…
Reference in New Issue
Block a user