mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge 0831f1bff2
into df03f1412d
This commit is contained in:
commit
69d6812d4b
@ -67,7 +67,7 @@ unsigned Assembly::codeSize(unsigned subTagSize) const
|
|||||||
ret += i.second.size();
|
ret += i.second.size();
|
||||||
|
|
||||||
for (AssemblyItem const& i: m_items)
|
for (AssemblyItem const& i: m_items)
|
||||||
ret += i.bytesRequired(tagSize, Precision::Approximate);
|
ret += i.bytesRequired(tagSize, m_evmVersion, Precision::Approximate);
|
||||||
if (numberEncodingSize(ret) <= tagSize)
|
if (numberEncodingSize(ret) <= tagSize)
|
||||||
return static_cast<unsigned>(ret);
|
return static_cast<unsigned>(ret);
|
||||||
}
|
}
|
||||||
@ -383,7 +383,7 @@ std::map<u256, u256> const& Assembly::optimiseInternal(
|
|||||||
|
|
||||||
if (_settings.runPeephole)
|
if (_settings.runPeephole)
|
||||||
{
|
{
|
||||||
PeepholeOptimiser peepOpt{m_items};
|
PeepholeOptimiser peepOpt{m_items, m_evmVersion};
|
||||||
while (peepOpt.optimise())
|
while (peepOpt.optimise())
|
||||||
{
|
{
|
||||||
count++;
|
count++;
|
||||||
|
@ -116,7 +116,7 @@ void AssemblyItem::setPushTagSubIdAndTag(size_t _subId, size_t _tag)
|
|||||||
setData(data);
|
setData(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t AssemblyItem::bytesRequired(size_t _addressLength, Precision _precision) const
|
size_t AssemblyItem::bytesRequired(size_t _addressLength, langutil::EVMVersion _evmVersion, Precision _precision) const
|
||||||
{
|
{
|
||||||
switch (m_type)
|
switch (m_type)
|
||||||
{
|
{
|
||||||
@ -124,7 +124,9 @@ size_t AssemblyItem::bytesRequired(size_t _addressLength, Precision _precision)
|
|||||||
case Tag: // 1 byte for the JUMPDEST
|
case Tag: // 1 byte for the JUMPDEST
|
||||||
return 1;
|
return 1;
|
||||||
case Push:
|
case Push:
|
||||||
return 1 + std::max<size_t>(1, numberEncodingSize(data()));
|
return
|
||||||
|
1 +
|
||||||
|
std::max<size_t>((_evmVersion.hasPush0() ? 0 : 1), numberEncodingSize(data()));
|
||||||
case PushSubSize:
|
case PushSubSize:
|
||||||
case PushProgramSize:
|
case PushProgramSize:
|
||||||
return 1 + 4; // worst case: a 16MB program
|
return 1 + 4; // worst case: a 16MB program
|
||||||
|
@ -159,10 +159,11 @@ public:
|
|||||||
|
|
||||||
/// @returns an upper bound for the number of bytes required by this item, assuming that
|
/// @returns an upper bound for the number of bytes required by this item, assuming that
|
||||||
/// the value of a jump tag takes @a _addressLength bytes.
|
/// the value of a jump tag takes @a _addressLength bytes.
|
||||||
|
/// @param _evmVersion the EVM version
|
||||||
/// @param _precision Whether to return a precise count (which involves
|
/// @param _precision Whether to return a precise count (which involves
|
||||||
/// counting immutable references which are only set after
|
/// counting immutable references which are only set after
|
||||||
/// a call to `assemble()`) or an approx. count.
|
/// a call to `assemble()`) or an approx. count.
|
||||||
size_t bytesRequired(size_t _addressLength, Precision _precision = Precision::Precise) const;
|
size_t bytesRequired(size_t _addressLength, langutil::EVMVersion _evmVersion, Precision _precision = Precision::Precise) const;
|
||||||
size_t arguments() const;
|
size_t arguments() const;
|
||||||
size_t returnValues() const;
|
size_t returnValues() const;
|
||||||
size_t deposit() const { return returnValues() - arguments(); }
|
size_t deposit() const { return returnValues() - arguments(); }
|
||||||
@ -204,11 +205,11 @@ private:
|
|||||||
mutable std::optional<size_t> m_immutableOccurrences;
|
mutable std::optional<size_t> m_immutableOccurrences;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline size_t bytesRequired(AssemblyItems const& _items, size_t _addressLength, Precision _precision = Precision::Precise)
|
inline size_t bytesRequired(AssemblyItems const& _items, size_t _addressLength, langutil::EVMVersion _evmVersion, Precision _precision = Precision::Precise)
|
||||||
{
|
{
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
for (AssemblyItem const& item: _items)
|
for (AssemblyItem const& item: _items)
|
||||||
size += item.bytesRequired(_addressLength, _precision);
|
size += item.bytesRequired(_addressLength, _evmVersion, _precision);
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ bigint ConstantOptimisationMethod::simpleRunGas(AssemblyItems const& _items, lan
|
|||||||
bigint gas = 0;
|
bigint gas = 0;
|
||||||
for (AssemblyItem const& item: _items)
|
for (AssemblyItem const& item: _items)
|
||||||
if (item.type() == Push)
|
if (item.type() == Push)
|
||||||
gas += GasMeter::runGas(Instruction::PUSH1, _evmVersion);
|
gas += GasMeter::pushGas(item.data(), _evmVersion);
|
||||||
else if (item.type() == Operation)
|
else if (item.type() == Operation)
|
||||||
{
|
{
|
||||||
if (item.instruction() == Instruction::EXP)
|
if (item.instruction() == Instruction::EXP)
|
||||||
@ -100,9 +100,9 @@ bigint ConstantOptimisationMethod::dataGas(bytes const& _data) const
|
|||||||
return bigint(GasMeter::dataGas(_data, m_params.isCreation, m_params.evmVersion));
|
return bigint(GasMeter::dataGas(_data, m_params.isCreation, m_params.evmVersion));
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t ConstantOptimisationMethod::bytesRequired(AssemblyItems const& _items)
|
size_t ConstantOptimisationMethod::bytesRequired(AssemblyItems const& _items, langutil::EVMVersion _evmVersion)
|
||||||
{
|
{
|
||||||
return evmasm::bytesRequired(_items, 3, Precision::Approximate); // assume 3 byte addresses
|
return evmasm::bytesRequired(_items, 3, _evmVersion, Precision::Approximate); // assume 3 byte addresses
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConstantOptimisationMethod::replaceConstants(
|
void ConstantOptimisationMethod::replaceConstants(
|
||||||
@ -143,7 +143,7 @@ bigint CodeCopyMethod::gasNeeded() const
|
|||||||
// Run gas: we ignore memory increase costs
|
// Run gas: we ignore memory increase costs
|
||||||
simpleRunGas(copyRoutine(), m_params.evmVersion) + GasCosts::copyGas,
|
simpleRunGas(copyRoutine(), m_params.evmVersion) + GasCosts::copyGas,
|
||||||
// Data gas for copy routines: Some bytes are zero, but we ignore them.
|
// Data gas for copy routines: Some bytes are zero, but we ignore them.
|
||||||
bytesRequired(copyRoutine()) * (m_params.isCreation ? GasCosts::txDataNonZeroGas(m_params.evmVersion) : GasCosts::createDataGas),
|
bytesRequired(copyRoutine(), m_params.evmVersion) * (m_params.isCreation ? GasCosts::txDataNonZeroGas(m_params.evmVersion) : GasCosts::createDataGas),
|
||||||
// Data gas for data itself
|
// Data gas for data itself
|
||||||
dataGas(toBigEndian(m_value))
|
dataGas(toBigEndian(m_value))
|
||||||
);
|
);
|
||||||
@ -153,37 +153,74 @@ AssemblyItems CodeCopyMethod::execute(Assembly& _assembly) const
|
|||||||
{
|
{
|
||||||
bytes data = toBigEndian(m_value);
|
bytes data = toBigEndian(m_value);
|
||||||
assertThrow(data.size() == 32, OptimizerException, "Invalid number encoding.");
|
assertThrow(data.size() == 32, OptimizerException, "Invalid number encoding.");
|
||||||
AssemblyItems actualCopyRoutine = copyRoutine();
|
AssemblyItem newPushData = _assembly.newData(data);
|
||||||
actualCopyRoutine[4] = _assembly.newData(data);
|
return copyRoutine(&newPushData);
|
||||||
return actualCopyRoutine;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AssemblyItems const& CodeCopyMethod::copyRoutine()
|
AssemblyItems CodeCopyMethod::copyRoutine(AssemblyItem* _pushData) const
|
||||||
{
|
{
|
||||||
AssemblyItems static copyRoutine{
|
if (_pushData)
|
||||||
// constant to be reused 3+ times
|
assertThrow(_pushData->type() == PushData, OptimizerException, "Invalid Assembly Item.");
|
||||||
u256(0),
|
|
||||||
|
|
||||||
// back up memory
|
AssemblyItem dataUsed = _pushData ? *_pushData : AssemblyItem(PushData, u256(1) << 16);
|
||||||
// mload(0)
|
|
||||||
Instruction::DUP1,
|
|
||||||
Instruction::MLOAD,
|
|
||||||
|
|
||||||
// codecopy(0, <offset>, 32)
|
// PUSH0 is cheaper than PUSHn/DUP/SWAP.
|
||||||
u256(32),
|
if (m_params.evmVersion.hasPush0())
|
||||||
AssemblyItem(PushData, u256(1) << 16), // replaced above in actualCopyRoutine[4]
|
{
|
||||||
Instruction::DUP4,
|
// This costs ~29 gas.
|
||||||
Instruction::CODECOPY,
|
AssemblyItems copyRoutine{
|
||||||
|
// back up memory
|
||||||
|
// mload(0)
|
||||||
|
u256(0),
|
||||||
|
Instruction::MLOAD,
|
||||||
|
|
||||||
// mload(0)
|
// codecopy(0, <offset>, 32)
|
||||||
Instruction::DUP2,
|
u256(32),
|
||||||
Instruction::MLOAD,
|
dataUsed,
|
||||||
|
u256(0),
|
||||||
|
Instruction::CODECOPY,
|
||||||
|
|
||||||
// restore original memory
|
// mload(0)
|
||||||
Instruction::SWAP2,
|
u256(0),
|
||||||
Instruction::MSTORE
|
Instruction::MLOAD,
|
||||||
};
|
|
||||||
return copyRoutine;
|
// restore original memory
|
||||||
|
// mstore(0, x)
|
||||||
|
Instruction::SWAP1,
|
||||||
|
u256(0),
|
||||||
|
Instruction::MSTORE
|
||||||
|
};
|
||||||
|
return copyRoutine;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// This costs ~33 gas.
|
||||||
|
AssemblyItems copyRoutine{
|
||||||
|
// constant to be reused 3+ times
|
||||||
|
u256(0),
|
||||||
|
|
||||||
|
// back up memory
|
||||||
|
// mload(0)
|
||||||
|
Instruction::DUP1,
|
||||||
|
Instruction::MLOAD,
|
||||||
|
|
||||||
|
// codecopy(0, <offset>, 32)
|
||||||
|
u256(32),
|
||||||
|
dataUsed,
|
||||||
|
Instruction::DUP4,
|
||||||
|
Instruction::CODECOPY,
|
||||||
|
|
||||||
|
// mload(0)
|
||||||
|
Instruction::DUP2,
|
||||||
|
Instruction::MLOAD,
|
||||||
|
|
||||||
|
// restore original memory
|
||||||
|
// mstore(0, x)
|
||||||
|
Instruction::SWAP2,
|
||||||
|
Instruction::MSTORE
|
||||||
|
};
|
||||||
|
return copyRoutine;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AssemblyItems ComputeMethod::findRepresentation(u256 const& _value)
|
AssemblyItems ComputeMethod::findRepresentation(u256 const& _value)
|
||||||
@ -323,7 +360,7 @@ bigint ComputeMethod::gasNeeded(AssemblyItems const& _routine) const
|
|||||||
return combineGas(
|
return combineGas(
|
||||||
simpleRunGas(_routine, m_params.evmVersion) + numExps * (GasCosts::expGas + GasCosts::expByteGas(m_params.evmVersion)),
|
simpleRunGas(_routine, m_params.evmVersion) + numExps * (GasCosts::expGas + GasCosts::expByteGas(m_params.evmVersion)),
|
||||||
// Data gas for routine: Some bytes are zero, but we ignore them.
|
// Data gas for routine: Some bytes are zero, but we ignore them.
|
||||||
bytesRequired(_routine) * (m_params.isCreation ? GasCosts::txDataNonZeroGas(m_params.evmVersion) : GasCosts::createDataGas),
|
bytesRequired(_routine, m_params.evmVersion) * (m_params.isCreation ? GasCosts::txDataNonZeroGas(m_params.evmVersion) : GasCosts::createDataGas),
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ protected:
|
|||||||
static bigint simpleRunGas(AssemblyItems const& _items, langutil::EVMVersion _evmVersion);
|
static bigint simpleRunGas(AssemblyItems const& _items, langutil::EVMVersion _evmVersion);
|
||||||
/// @returns the gas needed to store the given data literally
|
/// @returns the gas needed to store the given data literally
|
||||||
bigint dataGas(bytes const& _data) const;
|
bigint dataGas(bytes const& _data) const;
|
||||||
static size_t bytesRequired(AssemblyItems const& _items);
|
static size_t bytesRequired(AssemblyItems const& _items, langutil::EVMVersion _evmVersion);
|
||||||
/// @returns the combined estimated gas usage taking @a m_params into account.
|
/// @returns the combined estimated gas usage taking @a m_params into account.
|
||||||
bigint combineGas(
|
bigint combineGas(
|
||||||
bigint const& _runGas,
|
bigint const& _runGas,
|
||||||
@ -123,7 +123,7 @@ public:
|
|||||||
AssemblyItems execute(Assembly& _assembly) const override;
|
AssemblyItems execute(Assembly& _assembly) const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static AssemblyItems const& copyRoutine();
|
AssemblyItems copyRoutine(AssemblyItem* _pushData = nullptr) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -277,6 +277,14 @@ unsigned GasMeter::runGas(Instruction _instruction, langutil::EVMVersion _evmVer
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned GasMeter::pushGas(u256 _value, langutil::EVMVersion _evmVersion)
|
||||||
|
{
|
||||||
|
return runGas(
|
||||||
|
(_evmVersion.hasPush0() && _value == u256(0)) ? Instruction::PUSH0 : Instruction::PUSH1,
|
||||||
|
_evmVersion
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
u256 GasMeter::dataGas(bytes const& _data, bool _inCreation, langutil::EVMVersion _evmVersion)
|
u256 GasMeter::dataGas(bytes const& _data, bool _inCreation, langutil::EVMVersion _evmVersion)
|
||||||
{
|
{
|
||||||
bigint gas = 0;
|
bigint gas = 0;
|
||||||
|
@ -223,6 +223,9 @@ public:
|
|||||||
/// change with EVM versions)
|
/// change with EVM versions)
|
||||||
static unsigned runGas(Instruction _instruction, langutil::EVMVersion _evmVersion);
|
static unsigned runGas(Instruction _instruction, langutil::EVMVersion _evmVersion);
|
||||||
|
|
||||||
|
/// @returns gas costs for push instructions (may change depending on EVM version)
|
||||||
|
static unsigned pushGas(u256 _value, langutil::EVMVersion _evmVersion);
|
||||||
|
|
||||||
/// @returns the gas cost of the supplied data, depending whether it is in creation code, or not.
|
/// @returns the gas cost of the supplied data, depending whether it is in creation code, or not.
|
||||||
/// In case of @a _inCreation, the data is only sent as a transaction and is not stored, whereas
|
/// In case of @a _inCreation, the data is only sent as a transaction and is not stored, whereas
|
||||||
/// otherwise code will be stored and have to pay "createDataGas" cost.
|
/// otherwise code will be stored and have to pay "createDataGas" cost.
|
||||||
|
@ -59,10 +59,10 @@ u256 executionCost(RangeType const& _itemRange, langutil::EVMVersion _evmVersion
|
|||||||
}
|
}
|
||||||
/// @returns an estimation of the code size in bytes needed for the AssemblyItems in @a _itemRange.
|
/// @returns an estimation of the code size in bytes needed for the AssemblyItems in @a _itemRange.
|
||||||
template<typename RangeType>
|
template<typename RangeType>
|
||||||
uint64_t codeSize(RangeType const& _itemRange)
|
uint64_t codeSize(RangeType const& _itemRange, langutil::EVMVersion _evmVersion)
|
||||||
{
|
{
|
||||||
return ranges::accumulate(_itemRange | ranges::views::transform(
|
return ranges::accumulate(_itemRange | ranges::views::transform(
|
||||||
[](auto const& _item) { return _item.bytesRequired(2, Precision::Approximate); }
|
[&](auto const& _item) { return _item.bytesRequired(2, _evmVersion, Precision::Approximate); }
|
||||||
), 0u);
|
), 0u);
|
||||||
}
|
}
|
||||||
/// @returns the tag id, if @a _item is a PushTag or Tag into the current subassembly, std::nullopt otherwise.
|
/// @returns the tag id, if @a _item is a PushTag or Tag into the current subassembly, std::nullopt otherwise.
|
||||||
@ -139,7 +139,7 @@ std::map<size_t, Inliner::InlinableBlock> Inliner::determineInlinableBlocks(Asse
|
|||||||
bool Inliner::shouldInlineFullFunctionBody(size_t _tag, ranges::span<AssemblyItem const> _block, uint64_t _pushTagCount) const
|
bool Inliner::shouldInlineFullFunctionBody(size_t _tag, ranges::span<AssemblyItem const> _block, uint64_t _pushTagCount) const
|
||||||
{
|
{
|
||||||
// Accumulate size of the inline candidate block in bytes (without the return jump).
|
// Accumulate size of the inline candidate block in bytes (without the return jump).
|
||||||
uint64_t functionBodySize = codeSize(ranges::views::drop_last(_block, 1));
|
uint64_t functionBodySize = codeSize(ranges::views::drop_last(_block, 1), m_evmVersion);
|
||||||
|
|
||||||
// Use the number of push tags as approximation of the average number of calls to the function per run.
|
// Use the number of push tags as approximation of the average number of calls to the function per run.
|
||||||
uint64_t numberOfCalls = _pushTagCount;
|
uint64_t numberOfCalls = _pushTagCount;
|
||||||
@ -167,8 +167,8 @@ bool Inliner::shouldInlineFullFunctionBody(size_t _tag, ranges::span<AssemblyIte
|
|||||||
);
|
);
|
||||||
// Each call site deposits the call site pattern, whereas the jump site pattern and the function itself are deposited once.
|
// Each call site deposits the call site pattern, whereas the jump site pattern and the function itself are deposited once.
|
||||||
bigint uninlinedDepositCost = GasMeter::dataGas(
|
bigint uninlinedDepositCost = GasMeter::dataGas(
|
||||||
numberOfCallSites * codeSize(uninlinedCallSitePattern) +
|
numberOfCallSites * codeSize(uninlinedCallSitePattern, m_evmVersion) +
|
||||||
codeSize(uninlinedFunctionPattern) +
|
codeSize(uninlinedFunctionPattern, m_evmVersion) +
|
||||||
functionBodySize,
|
functionBodySize,
|
||||||
m_isCreation,
|
m_isCreation,
|
||||||
m_evmVersion
|
m_evmVersion
|
||||||
@ -185,7 +185,7 @@ bool Inliner::shouldInlineFullFunctionBody(size_t _tag, ranges::span<AssemblyIte
|
|||||||
// the heuristics is optimistic.
|
// the heuristics is optimistic.
|
||||||
if (m_tagsReferencedFromOutside.count(_tag))
|
if (m_tagsReferencedFromOutside.count(_tag))
|
||||||
inlinedDepositCost += GasMeter::dataGas(
|
inlinedDepositCost += GasMeter::dataGas(
|
||||||
codeSize(uninlinedFunctionPattern) + functionBodySize,
|
codeSize(uninlinedFunctionPattern, m_evmVersion) + functionBodySize,
|
||||||
m_isCreation,
|
m_isCreation,
|
||||||
m_evmVersion
|
m_evmVersion
|
||||||
);
|
);
|
||||||
@ -225,8 +225,8 @@ std::optional<AssemblyItem> Inliner::shouldInline(size_t _tag, AssemblyItem cons
|
|||||||
AssemblyItem{Instruction::JUMP},
|
AssemblyItem{Instruction::JUMP},
|
||||||
};
|
};
|
||||||
if (
|
if (
|
||||||
GasMeter::dataGas(codeSize(_block.items), m_isCreation, m_evmVersion) <=
|
GasMeter::dataGas(codeSize(_block.items, m_evmVersion), m_isCreation, m_evmVersion) <=
|
||||||
GasMeter::dataGas(codeSize(jumpPattern), m_isCreation, m_evmVersion)
|
GasMeter::dataGas(codeSize(jumpPattern, m_evmVersion), m_isCreation, m_evmVersion)
|
||||||
)
|
)
|
||||||
return blockExit;
|
return blockExit;
|
||||||
}
|
}
|
||||||
|
@ -520,7 +520,7 @@ bool PeepholeOptimiser::optimise()
|
|||||||
);
|
);
|
||||||
if (m_optimisedItems.size() < m_items.size() || (
|
if (m_optimisedItems.size() < m_items.size() || (
|
||||||
m_optimisedItems.size() == m_items.size() && (
|
m_optimisedItems.size() == m_items.size() && (
|
||||||
evmasm::bytesRequired(m_optimisedItems, 3, approx) < evmasm::bytesRequired(m_items, 3, approx) ||
|
evmasm::bytesRequired(m_optimisedItems, 3, m_evmVersion, approx) < evmasm::bytesRequired(m_items, 3, m_evmVersion, approx) ||
|
||||||
numberOfPops(m_optimisedItems) > numberOfPops(m_items)
|
numberOfPops(m_optimisedItems) > numberOfPops(m_items)
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
|
#include <liblangutil/EVMVersion.h>
|
||||||
|
|
||||||
namespace solidity::evmasm
|
namespace solidity::evmasm
|
||||||
{
|
{
|
||||||
class AssemblyItem;
|
class AssemblyItem;
|
||||||
@ -41,7 +43,11 @@ public:
|
|||||||
class PeepholeOptimiser
|
class PeepholeOptimiser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit PeepholeOptimiser(AssemblyItems& _items): m_items(_items) {}
|
explicit PeepholeOptimiser(AssemblyItems& _items, langutil::EVMVersion const _evmVersion):
|
||||||
|
m_items(_items),
|
||||||
|
m_evmVersion(_evmVersion)
|
||||||
|
{
|
||||||
|
}
|
||||||
virtual ~PeepholeOptimiser() = default;
|
virtual ~PeepholeOptimiser() = default;
|
||||||
|
|
||||||
bool optimise();
|
bool optimise();
|
||||||
@ -49,6 +55,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
AssemblyItems& m_items;
|
AssemblyItems& m_items;
|
||||||
AssemblyItems m_optimisedItems;
|
AssemblyItems m_optimisedItems;
|
||||||
|
langutil::EVMVersion const m_evmVersion;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -87,14 +87,16 @@ void GasMeterVisitor::operator()(FunctionCall const& _funCall)
|
|||||||
|
|
||||||
void GasMeterVisitor::operator()(Literal const& _lit)
|
void GasMeterVisitor::operator()(Literal const& _lit)
|
||||||
{
|
{
|
||||||
m_runGas += evmasm::GasMeter::runGas(evmasm::Instruction::PUSH1, m_dialect.evmVersion());
|
m_runGas += evmasm::GasMeter::pushGas(valueOfLiteral(_lit), m_dialect.evmVersion());
|
||||||
m_dataGas +=
|
|
||||||
singleByteDataGas() +
|
if (!m_dialect.evmVersion().hasPush0() || valueOfLiteral(_lit) != u256(0))
|
||||||
evmasm::GasMeter::dataGas(
|
m_dataGas +=
|
||||||
toCompactBigEndian(valueOfLiteral(_lit), 1),
|
singleByteDataGas() +
|
||||||
m_isCreation,
|
evmasm::GasMeter::dataGas(
|
||||||
m_dialect.evmVersion()
|
toCompactBigEndian(valueOfLiteral(_lit), 1),
|
||||||
);
|
m_isCreation,
|
||||||
|
m_dialect.evmVersion()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GasMeterVisitor::operator()(Identifier const&)
|
void GasMeterVisitor::operator()(Identifier const&)
|
||||||
@ -120,5 +122,7 @@ void GasMeterVisitor::instructionCostsInternal(evmasm::Instruction _instruction)
|
|||||||
m_runGas += evmasm::GasCosts::keccak256Gas + evmasm::GasCosts::keccak256WordGas;
|
m_runGas += evmasm::GasCosts::keccak256Gas + evmasm::GasCosts::keccak256WordGas;
|
||||||
else
|
else
|
||||||
m_runGas += evmasm::GasMeter::runGas(_instruction, m_dialect.evmVersion());
|
m_runGas += evmasm::GasMeter::runGas(_instruction, m_dialect.evmVersion());
|
||||||
m_dataGas += singleByteDataGas();
|
|
||||||
|
if (_instruction != evmasm::Instruction::PUSH0)
|
||||||
|
m_dataGas += singleByteDataGas();
|
||||||
}
|
}
|
||||||
|
@ -771,7 +771,7 @@ void StackLayoutGenerator::fillInJunk(CFG::BasicBlock const& _block, CFG::Functi
|
|||||||
yulAssert(util::contains(m_currentFunctionInfo->returnVariables, std::get<VariableSlot>(_slot)));
|
yulAssert(util::contains(m_currentFunctionInfo->returnVariables, std::get<VariableSlot>(_slot)));
|
||||||
// Strictly speaking the cost of the PUSH0 depends on the targeted EVM version, but the difference
|
// Strictly speaking the cost of the PUSH0 depends on the targeted EVM version, but the difference
|
||||||
// will not matter here.
|
// will not matter here.
|
||||||
opGas += evmasm::GasMeter::runGas(evmasm::pushInstruction(0), langutil::EVMVersion());;
|
opGas += evmasm::GasMeter::pushGas(u256(0), langutil::EVMVersion());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -42,6 +42,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_3
|
tag_3
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -42,6 +42,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_3
|
tag_3
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -40,6 +40,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_3
|
tag_3
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
{
|
{
|
||||||
"@f_14":
|
"@f_14":
|
||||||
{
|
{
|
||||||
"entryPoint": 124,
|
"entryPoint": 127,
|
||||||
"id": 14,
|
"id": 14,
|
||||||
"parameterSlots": 2,
|
"parameterSlots": 2,
|
||||||
"returnSlots": 1
|
"returnSlots": 1
|
||||||
@ -35,13 +35,13 @@
|
|||||||
},
|
},
|
||||||
"abi_decode_tuple_t_array$_t_uint256_$dyn_calldata_ptr":
|
"abi_decode_tuple_t_array$_t_uint256_$dyn_calldata_ptr":
|
||||||
{
|
{
|
||||||
"entryPoint": 158,
|
"entryPoint": 161,
|
||||||
"parameterSlots": 2,
|
"parameterSlots": 2,
|
||||||
"returnSlots": 2
|
"returnSlots": 2
|
||||||
},
|
},
|
||||||
"abi_decode_tuple_t_uint256":
|
"abi_decode_tuple_t_uint256":
|
||||||
{
|
{
|
||||||
"entryPoint": 269,
|
"entryPoint": 272,
|
||||||
"parameterSlots": 2,
|
"parameterSlots": 2,
|
||||||
"returnSlots": 1
|
"returnSlots": 1
|
||||||
},
|
},
|
||||||
@ -52,7 +52,7 @@
|
|||||||
},
|
},
|
||||||
"panic_error_0x32":
|
"panic_error_0x32":
|
||||||
{
|
{
|
||||||
"entryPoint": 292,
|
"entryPoint": 295,
|
||||||
"parameterSlots": 0,
|
"parameterSlots": 0,
|
||||||
"returnSlots": 0
|
"returnSlots": 0
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_3
|
tag_3
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -73,6 +73,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_3
|
tag_3
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -42,6 +42,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_3
|
tag_3
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -50,6 +50,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_3
|
tag_3
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -52,6 +52,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_5
|
tag_5
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -74,6 +74,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_4
|
tag_4
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -42,6 +42,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_3
|
tag_3
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -42,6 +42,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_3
|
tag_3
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -48,6 +48,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_3
|
tag_3
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -48,6 +48,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_3
|
tag_3
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -46,6 +46,9 @@ sub_0: assembly {
|
|||||||
eq
|
eq
|
||||||
tag_3
|
tag_3
|
||||||
jumpi
|
jumpi
|
||||||
|
0x00
|
||||||
|
dup1
|
||||||
|
revert
|
||||||
tag_2:
|
tag_2:
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
@ -1001,7 +1001,7 @@ BOOST_AUTO_TEST_CASE(clear_unreachable_code)
|
|||||||
AssemblyItem(PushTag, 1),
|
AssemblyItem(PushTag, 1),
|
||||||
Instruction::JUMP
|
Instruction::JUMP
|
||||||
};
|
};
|
||||||
PeepholeOptimiser peepOpt(items);
|
PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion());
|
||||||
BOOST_REQUIRE(peepOpt.optimise());
|
BOOST_REQUIRE(peepOpt.optimise());
|
||||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||||
items.begin(), items.end(),
|
items.begin(), items.end(),
|
||||||
@ -1027,7 +1027,7 @@ BOOST_AUTO_TEST_CASE(peephole_double_push)
|
|||||||
u256(4),
|
u256(4),
|
||||||
u256(5)
|
u256(5)
|
||||||
};
|
};
|
||||||
PeepholeOptimiser peepOpt(items);
|
PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion());
|
||||||
BOOST_REQUIRE(peepOpt.optimise());
|
BOOST_REQUIRE(peepOpt.optimise());
|
||||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||||
items.begin(), items.end(),
|
items.begin(), items.end(),
|
||||||
@ -1043,7 +1043,7 @@ BOOST_AUTO_TEST_CASE(peephole_pop_calldatasize)
|
|||||||
Instruction::LT,
|
Instruction::LT,
|
||||||
Instruction::POP
|
Instruction::POP
|
||||||
};
|
};
|
||||||
PeepholeOptimiser peepOpt(items);
|
PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion());
|
||||||
for (size_t i = 0; i < 3; i++)
|
for (size_t i = 0; i < 3; i++)
|
||||||
BOOST_CHECK(peepOpt.optimise());
|
BOOST_CHECK(peepOpt.optimise());
|
||||||
BOOST_CHECK(items.empty());
|
BOOST_CHECK(items.empty());
|
||||||
@ -1076,7 +1076,7 @@ BOOST_AUTO_TEST_CASE(peephole_commutative_swap1)
|
|||||||
u256(4),
|
u256(4),
|
||||||
u256(5)
|
u256(5)
|
||||||
};
|
};
|
||||||
PeepholeOptimiser peepOpt(items);
|
PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion());
|
||||||
BOOST_REQUIRE(peepOpt.optimise());
|
BOOST_REQUIRE(peepOpt.optimise());
|
||||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||||
items.begin(), items.end(),
|
items.begin(), items.end(),
|
||||||
@ -1114,7 +1114,7 @@ BOOST_AUTO_TEST_CASE(peephole_noncommutative_swap1)
|
|||||||
u256(4),
|
u256(4),
|
||||||
u256(5)
|
u256(5)
|
||||||
};
|
};
|
||||||
PeepholeOptimiser peepOpt(items);
|
PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion());
|
||||||
BOOST_REQUIRE(!peepOpt.optimise());
|
BOOST_REQUIRE(!peepOpt.optimise());
|
||||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||||
items.begin(), items.end(),
|
items.begin(), items.end(),
|
||||||
@ -1149,7 +1149,7 @@ BOOST_AUTO_TEST_CASE(peephole_swap_comparison)
|
|||||||
u256(4),
|
u256(4),
|
||||||
u256(5)
|
u256(5)
|
||||||
};
|
};
|
||||||
PeepholeOptimiser peepOpt(items);
|
PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion());
|
||||||
BOOST_REQUIRE(peepOpt.optimise());
|
BOOST_REQUIRE(peepOpt.optimise());
|
||||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||||
items.begin(), items.end(),
|
items.begin(), items.end(),
|
||||||
@ -1175,7 +1175,7 @@ BOOST_AUTO_TEST_CASE(peephole_truthy_and)
|
|||||||
AssemblyItem(PushTag, 1),
|
AssemblyItem(PushTag, 1),
|
||||||
Instruction::JUMPI
|
Instruction::JUMPI
|
||||||
};
|
};
|
||||||
PeepholeOptimiser peepOpt(items);
|
PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion());
|
||||||
BOOST_REQUIRE(peepOpt.optimise());
|
BOOST_REQUIRE(peepOpt.optimise());
|
||||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||||
items.begin(), items.end(),
|
items.begin(), items.end(),
|
||||||
@ -1208,7 +1208,7 @@ BOOST_AUTO_TEST_CASE(peephole_iszero_iszero_jumpi)
|
|||||||
u256(0x20),
|
u256(0x20),
|
||||||
Instruction::RETURN
|
Instruction::RETURN
|
||||||
};
|
};
|
||||||
PeepholeOptimiser peepOpt(items);
|
PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion());
|
||||||
BOOST_REQUIRE(peepOpt.optimise());
|
BOOST_REQUIRE(peepOpt.optimise());
|
||||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||||
items.begin(), items.end(),
|
items.begin(), items.end(),
|
||||||
@ -1878,8 +1878,9 @@ BOOST_AUTO_TEST_CASE(inliner_revert_increased_datagas)
|
|||||||
{
|
{
|
||||||
// Inlining this would increase data gas (5 bytes v/s 4 bytes), therefore, skipped.
|
// Inlining this would increase data gas (5 bytes v/s 4 bytes), therefore, skipped.
|
||||||
AssemblyItems items{
|
AssemblyItems items{
|
||||||
AssemblyItem(PushTag, 1),
|
u256(0),
|
||||||
Instruction::JUMP,
|
u256(0),
|
||||||
|
Instruction::REVERT,
|
||||||
AssemblyItem(Tag, 1),
|
AssemblyItem(Tag, 1),
|
||||||
u256(0),
|
u256(0),
|
||||||
u256(0),
|
u256(0),
|
||||||
|
@ -169,13 +169,14 @@ BOOST_AUTO_TEST_CASE(location_test)
|
|||||||
AssemblyItems items = compileContract(make_shared<CharStream>(sourceCode, ""));
|
AssemblyItems items = compileContract(make_shared<CharStream>(sourceCode, ""));
|
||||||
shared_ptr<string> sourceName = make_shared<string>();
|
shared_ptr<string> sourceName = make_shared<string>();
|
||||||
bool hasShifts = solidity::test::CommonOptions::get().evmVersion().hasBitwiseShifting();
|
bool hasShifts = solidity::test::CommonOptions::get().evmVersion().hasBitwiseShifting();
|
||||||
|
bool hasPush0 = solidity::test::CommonOptions::get().evmVersion().hasPush0();
|
||||||
|
|
||||||
auto codegenCharStream = make_shared<CharStream>("", "--CODEGEN--");
|
auto codegenCharStream = make_shared<CharStream>("", "--CODEGEN--");
|
||||||
|
|
||||||
vector<SourceLocation> locations;
|
vector<SourceLocation> locations;
|
||||||
if (solidity::test::CommonOptions::get().optimize)
|
if (solidity::test::CommonOptions::get().optimize)
|
||||||
locations =
|
locations =
|
||||||
vector<SourceLocation>(31, SourceLocation{23, 103, sourceName}) +
|
vector<SourceLocation>(hasPush0 ? 34 : 31, SourceLocation{23, 103, sourceName}) +
|
||||||
vector<SourceLocation>(1, SourceLocation{41, 100, sourceName}) +
|
vector<SourceLocation>(1, SourceLocation{41, 100, sourceName}) +
|
||||||
vector<SourceLocation>(1, SourceLocation{93, 95, sourceName}) +
|
vector<SourceLocation>(1, SourceLocation{93, 95, sourceName}) +
|
||||||
vector<SourceLocation>(15, SourceLocation{41, 100, sourceName});
|
vector<SourceLocation>(15, SourceLocation{41, 100, sourceName});
|
||||||
|
@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE(string_storage)
|
|||||||
CHECK_DEPLOY_GAS(0, 97697, evmVersion);
|
CHECK_DEPLOY_GAS(0, 97697, evmVersion);
|
||||||
// Shanghai is cheaper due to `push0`
|
// Shanghai is cheaper due to `push0`
|
||||||
else
|
else
|
||||||
CHECK_DEPLOY_GAS(0, 97071, evmVersion);
|
CHECK_DEPLOY_GAS(0, 97719, evmVersion);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -134,7 +134,7 @@ BOOST_AUTO_TEST_CASE(string_storage)
|
|||||||
else if (evmVersion < EVMVersion::shanghai())
|
else if (evmVersion < EVMVersion::shanghai())
|
||||||
CHECK_DEPLOY_GAS(114077, 96461, evmVersion);
|
CHECK_DEPLOY_GAS(114077, 96461, evmVersion);
|
||||||
else
|
else
|
||||||
CHECK_DEPLOY_GAS(114077, 95835, evmVersion);
|
CHECK_DEPLOY_GAS(114077, 96483, evmVersion);
|
||||||
|
|
||||||
if (evmVersion >= EVMVersion::byzantium())
|
if (evmVersion >= EVMVersion::byzantium())
|
||||||
{
|
{
|
||||||
|
@ -17,9 +17,9 @@ contract C {
|
|||||||
// optimize-yul: true
|
// optimize-yul: true
|
||||||
// ----
|
// ----
|
||||||
// creation:
|
// creation:
|
||||||
// codeDepositCost: 638600
|
// codeDepositCost: 639200
|
||||||
// executionCost: 668
|
// executionCost: 668
|
||||||
// totalCost: 639268
|
// totalCost: 639868
|
||||||
// external:
|
// external:
|
||||||
// a(): 2283
|
// a(): 2283
|
||||||
// b(uint256): 4649
|
// b(uint256): 4649
|
||||||
|
@ -27,9 +27,9 @@ contract Large {
|
|||||||
// optimize-runs: 2
|
// optimize-runs: 2
|
||||||
// ----
|
// ----
|
||||||
// creation:
|
// creation:
|
||||||
// codeDepositCost: 224600
|
// codeDepositCost: 225200
|
||||||
// executionCost: 267
|
// executionCost: 267
|
||||||
// totalCost: 224867
|
// totalCost: 225467
|
||||||
// external:
|
// external:
|
||||||
// a(): 2281
|
// a(): 2281
|
||||||
// b(uint256): 4934
|
// b(uint256): 4934
|
||||||
|
@ -14,9 +14,9 @@ contract Medium {
|
|||||||
// optimize-runs: 2
|
// optimize-runs: 2
|
||||||
// ----
|
// ----
|
||||||
// creation:
|
// creation:
|
||||||
// codeDepositCost: 126000
|
// codeDepositCost: 126600
|
||||||
// executionCost: 169
|
// executionCost: 169
|
||||||
// totalCost: 126169
|
// totalCost: 126769
|
||||||
// external:
|
// external:
|
||||||
// a(): 2281
|
// a(): 2281
|
||||||
// b(uint256): 4692
|
// b(uint256): 4692
|
||||||
|
@ -19,9 +19,9 @@ contract C {
|
|||||||
// optimize-yul: true
|
// optimize-yul: true
|
||||||
// ----
|
// ----
|
||||||
// creation:
|
// creation:
|
||||||
// codeDepositCost: 35800
|
// codeDepositCost: 36400
|
||||||
// executionCost: 85
|
// executionCost: 85
|
||||||
// totalCost: 35885
|
// totalCost: 36485
|
||||||
// external:
|
// external:
|
||||||
// exp_neg_one(uint256): 1914
|
// exp_neg_one(uint256): 1914
|
||||||
// exp_one(uint256): 1868
|
// exp_one(uint256): 1868
|
||||||
|
@ -15,9 +15,9 @@ contract C {
|
|||||||
// optimize-yul: true
|
// optimize-yul: true
|
||||||
// ----
|
// ----
|
||||||
// creation:
|
// creation:
|
||||||
// codeDepositCost: 25600
|
// codeDepositCost: 26200
|
||||||
// executionCost: 73
|
// executionCost: 79
|
||||||
// totalCost: 25673
|
// totalCost: 26279
|
||||||
// external:
|
// external:
|
||||||
// readX(): 2288
|
// readX(): 2288
|
||||||
// resetX(): 5114
|
// resetX(): 5114
|
||||||
|
@ -51,5 +51,5 @@ contract C {
|
|||||||
// f3() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc"
|
// f3() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc"
|
||||||
// f4() -> 0x20, 0x160, 0x1, 0x80, 0xc0, 0x2, 0x3, "abc", 0x7, 0x40, 0x2, 0x2, 0x3
|
// f4() -> 0x20, 0x160, 0x1, 0x80, 0xc0, 0x2, 0x3, "abc", 0x7, 0x40, 0x2, 0x2, 0x3
|
||||||
// gas irOptimized: 112630
|
// gas irOptimized: 112630
|
||||||
// gas legacy: 114794
|
// gas legacy: 114793
|
||||||
// gas legacyOptimized: 112572
|
// gas legacyOptimized: 112572
|
||||||
|
@ -32,4 +32,4 @@ contract C is B {
|
|||||||
// test() -> 77
|
// test() -> 77
|
||||||
// gas irOptimized: 110325
|
// gas irOptimized: 110325
|
||||||
// gas legacy: 151866
|
// gas legacy: 151866
|
||||||
// gas legacyOptimized: 110359
|
// gas legacyOptimized: 110959
|
||||||
|
@ -12,7 +12,7 @@ contract Test {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// set(uint24[3][]): 0x20, 0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12 -> 0x06
|
// set(uint24[3][]): 0x20, 0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12 -> 0x06
|
||||||
// gas irOptimized: 186554
|
// gas irOptimized: 186551
|
||||||
// gas legacy: 211054
|
// gas legacy: 211054
|
||||||
// gas legacyOptimized: 206042
|
// gas legacyOptimized: 206042
|
||||||
// data(uint256,uint256): 0x02, 0x02 -> 0x09
|
// data(uint256,uint256): 0x02, 0x02 -> 0x09
|
||||||
|
@ -17,6 +17,6 @@ contract c {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// test() -> 0
|
// test() -> 0
|
||||||
// gas irOptimized: 125058
|
// gas irOptimized: 125123
|
||||||
// gas legacy: 150372
|
// gas legacy: 150372
|
||||||
// gas legacyOptimized: 146391
|
// gas legacyOptimized: 146391
|
||||||
|
@ -10,7 +10,7 @@ contract C {
|
|||||||
// constructor(): 1, 2, 3 ->
|
// constructor(): 1, 2, 3 ->
|
||||||
// gas irOptimized: 139656
|
// gas irOptimized: 139656
|
||||||
// gas legacy: 180517
|
// gas legacy: 180517
|
||||||
// gas legacyOptimized: 150462
|
// gas legacyOptimized: 151110
|
||||||
// a(uint256): 0 -> 1
|
// a(uint256): 0 -> 1
|
||||||
// a(uint256): 1 -> 2
|
// a(uint256): 1 -> 2
|
||||||
// a(uint256): 2 -> 3
|
// a(uint256): 2 -> 3
|
||||||
|
@ -46,6 +46,6 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// f() -> true
|
// f() -> true
|
||||||
// gas irOptimized: 117261
|
// gas irOptimized: 117206
|
||||||
// gas legacy: 124660
|
// gas legacy: 124659
|
||||||
// gas legacyOptimized: 122801
|
// gas legacyOptimized: 122801
|
||||||
|
@ -18,6 +18,6 @@ contract c {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x05000000000000000000000000000000000000000000000000
|
// test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x05000000000000000000000000000000000000000000000000
|
||||||
// gas irOptimized: 208053
|
// gas irOptimized: 207993
|
||||||
// gas legacy: 221769
|
// gas legacy: 221769
|
||||||
// gas legacyOptimized: 220611
|
// gas legacyOptimized: 220611
|
||||||
|
@ -18,5 +18,5 @@ contract c {
|
|||||||
// ----
|
// ----
|
||||||
// test() -> 5, 4
|
// test() -> 5, 4
|
||||||
// gas irOptimized: 205045
|
// gas irOptimized: 205045
|
||||||
// gas legacy: 213863
|
// gas legacy: 213864
|
||||||
// gas legacyOptimized: 212902
|
// gas legacyOptimized: 212902
|
||||||
|
@ -22,5 +22,5 @@ contract c {
|
|||||||
// ----
|
// ----
|
||||||
// test() -> 3, 4
|
// test() -> 3, 4
|
||||||
// gas irOptimized: 169586
|
// gas irOptimized: 169586
|
||||||
// gas legacy: 175424
|
// gas legacy: 175419
|
||||||
// gas legacyOptimized: 172535
|
// gas legacyOptimized: 172535
|
||||||
|
@ -15,7 +15,7 @@ contract c {
|
|||||||
// ----
|
// ----
|
||||||
// setData1(uint256,uint256,uint256): 10, 5, 4 ->
|
// setData1(uint256,uint256,uint256): 10, 5, 4 ->
|
||||||
// copyStorageStorage() ->
|
// copyStorageStorage() ->
|
||||||
// gas irOptimized: 111348
|
// gas irOptimized: 111345
|
||||||
// gas legacy: 109272
|
// gas legacy: 109272
|
||||||
// gas legacyOptimized: 109262
|
// gas legacyOptimized: 109262
|
||||||
// getData2(uint256): 5 -> 10, 4
|
// getData2(uint256): 5 -> 10, 4
|
||||||
|
@ -18,5 +18,5 @@ contract c {
|
|||||||
// ----
|
// ----
|
||||||
// test() -> 5, 4
|
// test() -> 5, 4
|
||||||
// gas irOptimized: 252929
|
// gas irOptimized: 252929
|
||||||
// gas legacy: 250892
|
// gas legacy: 250893
|
||||||
// gas legacyOptimized: 250046
|
// gas legacyOptimized: 250046
|
||||||
|
@ -15,6 +15,6 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// f() -> 0x20, 2, 0x40, 0xa0, 2, 0, 1, 2, 2, 3
|
// f() -> 0x20, 2, 0x40, 0xa0, 2, 0, 1, 2, 2, 3
|
||||||
// gas irOptimized: 161624
|
// gas irOptimized: 161627
|
||||||
// gas legacy: 162203
|
// gas legacy: 162201
|
||||||
// gas legacyOptimized: 159934
|
// gas legacyOptimized: 159934
|
||||||
|
@ -53,8 +53,8 @@ contract C {
|
|||||||
// ----
|
// ----
|
||||||
// from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
// from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
||||||
// gas irOptimized: 150004
|
// gas irOptimized: 150004
|
||||||
// gas legacy: 150745
|
// gas legacy: 150741
|
||||||
// gas legacyOptimized: 148678
|
// gas legacyOptimized: 148672
|
||||||
// from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
// from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
||||||
// from_memory() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
// from_memory() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
||||||
// from_calldata(uint8[][]): 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
// from_calldata(uint8[][]): 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
||||||
|
@ -38,12 +38,12 @@ contract Test {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// test() -> 24
|
// test() -> 24
|
||||||
// gas irOptimized: 226666
|
// gas irOptimized: 226652
|
||||||
// gas legacy: 227084
|
// gas legacy: 227084
|
||||||
// gas legacyOptimized: 226529
|
// gas legacyOptimized: 226529
|
||||||
// test1() -> 3
|
// test1() -> 3
|
||||||
// test2() -> 6
|
// test2() -> 6
|
||||||
// test3() -> 24
|
// test3() -> 24
|
||||||
// gas irOptimized: 141223
|
// gas irOptimized: 141217
|
||||||
// gas legacy: 142238
|
// gas legacy: 142238
|
||||||
// gas legacyOptimized: 141365
|
// gas legacyOptimized: 141365
|
||||||
|
@ -37,8 +37,8 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
// from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
||||||
// gas irOptimized: 147871
|
// gas irOptimized: 147862
|
||||||
// gas legacy: 148896
|
// gas legacy: 148894
|
||||||
// gas legacyOptimized: 146901
|
// gas legacyOptimized: 146895
|
||||||
// from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
// from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
||||||
// from_memory() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
// from_memory() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14
|
||||||
|
@ -21,21 +21,21 @@ contract c {
|
|||||||
// gas legacy: 123948
|
// gas legacy: 123948
|
||||||
// gas legacyOptimized: 118948
|
// gas legacyOptimized: 118948
|
||||||
// f(uint256): 32 -> 0x20, 0x20, 1780731860627700044960722568376592200742329637303199754547598369979440671
|
// f(uint256): 32 -> 0x20, 0x20, 1780731860627700044960722568376592200742329637303199754547598369979440671
|
||||||
// gas irOptimized: 124049
|
// gas irOptimized: 123843
|
||||||
// gas legacy: 140362
|
// gas legacy: 140362
|
||||||
// gas legacyOptimized: 135386
|
// gas legacyOptimized: 135386
|
||||||
// f(uint256): 33 -> 0x20, 33, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x2000000000000000000000000000000000000000000000000000000000000000
|
// f(uint256): 33 -> 0x20, 33, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x2000000000000000000000000000000000000000000000000000000000000000
|
||||||
// gas irOptimized: 130665
|
// gas irOptimized: 130444
|
||||||
// gas legacy: 147916
|
// gas legacy: 147916
|
||||||
// gas legacyOptimized: 142278
|
// gas legacyOptimized: 142278
|
||||||
// f(uint256): 63 -> 0x20, 0x3f, 1780731860627700044960722568376592200742329637303199754547598369979440671, 14532552714582660066924456880521368950258152170031413196862950297402215316992
|
// f(uint256): 63 -> 0x20, 0x3f, 1780731860627700044960722568376592200742329637303199754547598369979440671, 14532552714582660066924456880521368950258152170031413196862950297402215316992
|
||||||
// gas irOptimized: 139545
|
// gas irOptimized: 139144
|
||||||
// gas legacy: 171136
|
// gas legacy: 171136
|
||||||
// gas legacyOptimized: 161538
|
// gas legacyOptimized: 161538
|
||||||
// f(uint256): 12 -> 0x20, 0x0c, 0x0102030405060708090a0b0000000000000000000000000000000000000000
|
// f(uint256): 12 -> 0x20, 0x0c, 0x0102030405060708090a0b0000000000000000000000000000000000000000
|
||||||
// gas legacy: 59345
|
// gas legacy: 59345
|
||||||
// gas legacyOptimized: 57279
|
// gas legacyOptimized: 57279
|
||||||
// f(uint256): 129 -> 0x20, 0x81, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f, 29063324697304692433803953038474361308315562010425523193971352996434451193439, 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f, -57896044618658097711785492504343953926634992332820282019728792003956564819968
|
// f(uint256): 129 -> 0x20, 0x81, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f, 29063324697304692433803953038474361308315562010425523193971352996434451193439, 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f, -57896044618658097711785492504343953926634992332820282019728792003956564819968
|
||||||
// gas irOptimized: 442421
|
// gas irOptimized: 441621
|
||||||
// gas legacy: 505021
|
// gas legacy: 505021
|
||||||
// gas legacyOptimized: 486997
|
// gas legacyOptimized: 486997
|
||||||
|
@ -10,5 +10,5 @@ contract C {
|
|||||||
// ----
|
// ----
|
||||||
// f(uint256[]): 0x20, 0x03, 0x1, 0x2, 0x3 -> 0x1
|
// f(uint256[]): 0x20, 0x03, 0x1, 0x2, 0x3 -> 0x1
|
||||||
// gas irOptimized: 110962
|
// gas irOptimized: 110962
|
||||||
// gas legacy: 111551
|
// gas legacy: 111550
|
||||||
// gas legacyOptimized: 111339
|
// gas legacyOptimized: 111339
|
||||||
|
@ -18,5 +18,5 @@ contract C {
|
|||||||
// constructor()
|
// constructor()
|
||||||
// gas irOptimized: 226349
|
// gas irOptimized: 226349
|
||||||
// gas legacy: 215757
|
// gas legacy: 215757
|
||||||
// gas legacyOptimized: 181760
|
// gas legacyOptimized: 182408
|
||||||
// f() -> 0
|
// f() -> 0
|
||||||
|
@ -35,11 +35,11 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// f() -> 0x40, 0x80, 6, 0x6162636465660000000000000000000000000000000000000000000000000000, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000
|
// f() -> 0x40, 0x80, 6, 0x6162636465660000000000000000000000000000000000000000000000000000, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000
|
||||||
// gas irOptimized: 179734
|
// gas irOptimized: 179731
|
||||||
// gas legacy: 181001
|
// gas legacy: 181001
|
||||||
// gas legacyOptimized: 180018
|
// gas legacyOptimized: 180018
|
||||||
// g() -> 0x40, 0xc0, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000, 0x11, 0x3132333435363738393233343536373839000000000000000000000000000000
|
// g() -> 0x40, 0xc0, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000, 0x11, 0x3132333435363738393233343536373839000000000000000000000000000000
|
||||||
// gas irOptimized: 106663
|
// gas irOptimized: 106657
|
||||||
// gas legacy: 109720
|
// gas legacy: 109720
|
||||||
// gas legacyOptimized: 106932
|
// gas legacyOptimized: 106932
|
||||||
// h() -> 0x40, 0x60, 0x00, 0x00
|
// h() -> 0x40, 0x60, 0x00, 0x00
|
||||||
|
@ -15,6 +15,6 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// test() -> 7
|
// test() -> 7
|
||||||
// gas irOptimized: 122456
|
// gas irOptimized: 122442
|
||||||
// gas legacy: 205176
|
// gas legacy: 205176
|
||||||
// gas legacyOptimized: 204971
|
// gas legacyOptimized: 204971
|
||||||
|
@ -7,7 +7,7 @@ contract c {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// set(): 1, 2, 3, 4, 5 -> true
|
// set(): 1, 2, 3, 4, 5 -> true
|
||||||
// gas irOptimized: 177375
|
// gas irOptimized: 177372
|
||||||
// gas legacy: 177954
|
// gas legacy: 177954
|
||||||
// gas legacyOptimized: 177553
|
// gas legacyOptimized: 177553
|
||||||
// storageEmpty -> 0
|
// storageEmpty -> 0
|
||||||
|
@ -18,7 +18,7 @@ contract sender {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// (): 7 ->
|
// (): 7 ->
|
||||||
// gas irOptimized: 110831
|
// gas irOptimized: 110822
|
||||||
// gas legacy: 111388
|
// gas legacy: 111388
|
||||||
// gas legacyOptimized: 111070
|
// gas legacyOptimized: 111070
|
||||||
// val() -> 0
|
// val() -> 0
|
||||||
|
@ -46,11 +46,11 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// test() -> 0x20, 0x14, "[a called][b called]"
|
// test() -> 0x20, 0x14, "[a called][b called]"
|
||||||
// gas irOptimized: 116633
|
// gas irOptimized: 116622
|
||||||
// gas legacy: 118936
|
// gas legacy: 118936
|
||||||
// gas legacyOptimized: 116975
|
// gas legacyOptimized: 116975
|
||||||
// test2() -> 0x20, 0x14, "[b called][a called]"
|
// test2() -> 0x20, 0x14, "[b called][a called]"
|
||||||
// test3() -> 0x20, 0x14, "[b called][a called]"
|
// test3() -> 0x20, 0x14, "[b called][a called]"
|
||||||
// gas irOptimized: 103243
|
// gas irOptimized: 103238
|
||||||
// gas legacy: 102745
|
// gas legacy: 102745
|
||||||
// gas legacyOptimized: 101669
|
// gas legacyOptimized: 101669
|
||||||
|
@ -14,5 +14,5 @@ contract C {
|
|||||||
// ----
|
// ----
|
||||||
// f() -> 2, 3, 4
|
// f() -> 2, 3, 4
|
||||||
// gas irOptimized: 109698
|
// gas irOptimized: 109698
|
||||||
// gas legacy: 126129
|
// gas legacy: 126128
|
||||||
// gas legacyOptimized: 120622
|
// gas legacyOptimized: 120622
|
||||||
|
@ -20,4 +20,4 @@ contract B {
|
|||||||
// f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004
|
// f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004
|
||||||
// gas irOptimized: 114204
|
// gas irOptimized: 114204
|
||||||
// gas legacy: 230001
|
// gas legacy: 230001
|
||||||
// gas legacyOptimized: 130637
|
// gas legacyOptimized: 131242
|
||||||
|
@ -11,6 +11,6 @@ contract Creator {
|
|||||||
// constructor(): 1, 2, 3, 4 ->
|
// constructor(): 1, 2, 3, 4 ->
|
||||||
// gas irOptimized: 126363
|
// gas irOptimized: 126363
|
||||||
// gas legacy: 174186
|
// gas legacy: 174186
|
||||||
// gas legacyOptimized: 128709
|
// gas legacyOptimized: 129357
|
||||||
// r() -> 4
|
// r() -> 4
|
||||||
// ch() -> 3
|
// ch() -> 3
|
||||||
|
@ -44,4 +44,4 @@ contract C {
|
|||||||
// test() -> 5, 6, 7
|
// test() -> 5, 6, 7
|
||||||
// gas irOptimized: 256077
|
// gas irOptimized: 256077
|
||||||
// gas legacy: 441556
|
// gas legacy: 441556
|
||||||
// gas legacyOptimized: 279321
|
// gas legacyOptimized: 279921
|
||||||
|
@ -40,7 +40,7 @@ contract C {
|
|||||||
// copyFromStorageShort()
|
// copyFromStorageShort()
|
||||||
// x() -> 0x20, 3, 0x6162630000000000000000000000000000000000000000000000000000000000
|
// x() -> 0x20, 3, 0x6162630000000000000000000000000000000000000000000000000000000000
|
||||||
// copyFromStorageLong()
|
// copyFromStorageLong()
|
||||||
// gas irOptimized: 121104
|
// gas irOptimized: 121092
|
||||||
// gas legacy: 121904
|
// gas legacy: 121904
|
||||||
// gas legacyOptimized: 121400
|
// gas legacyOptimized: 121400
|
||||||
// x() -> 0x20, 0x25, 0x3132333435363738393031323334353637383930313233343536373839303132, 0x3334353637000000000000000000000000000000000000000000000000000000
|
// x() -> 0x20, 0x25, 0x3132333435363738393031323334353637383930313233343536373839303132, 0x3334353637000000000000000000000000000000000000000000000000000000
|
||||||
|
@ -16,7 +16,7 @@ contract c {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// test() -> true
|
// test() -> true
|
||||||
// gas irOptimized: 140154
|
// gas irOptimized: 139984
|
||||||
// gas legacy: 178397
|
// gas legacy: 178397
|
||||||
// gas legacyOptimized: 163832
|
// gas legacyOptimized: 163832
|
||||||
// storageEmpty -> 1
|
// storageEmpty -> 1
|
||||||
|
@ -15,7 +15,7 @@ contract c {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// test() ->
|
// test() ->
|
||||||
// gas irOptimized: 113782
|
// gas irOptimized: 113734
|
||||||
// gas legacy: 131245
|
// gas legacy: 131245
|
||||||
// gas legacyOptimized: 126668
|
// gas legacyOptimized: 126668
|
||||||
// storageEmpty -> 1
|
// storageEmpty -> 1
|
||||||
|
@ -9,6 +9,6 @@ contract c {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// test() -> 0x20, 33, 0x303030303030303030303030303030303030303030303030303030303030303, 0x0300000000000000000000000000000000000000000000000000000000000000
|
// test() -> 0x20, 33, 0x303030303030303030303030303030303030303030303030303030303030303, 0x0300000000000000000000000000000000000000000000000000000000000000
|
||||||
// gas irOptimized: 107976
|
// gas irOptimized: 107954
|
||||||
// gas legacy: 125420
|
// gas legacy: 125420
|
||||||
// gas legacyOptimized: 122472
|
// gas legacyOptimized: 122472
|
||||||
|
@ -17,5 +17,5 @@ contract c {
|
|||||||
// ----
|
// ----
|
||||||
// test() -> 5, 4, 3, 3
|
// test() -> 5, 4, 3, 3
|
||||||
// gas irOptimized: 111363
|
// gas irOptimized: 111363
|
||||||
// gas legacy: 111807
|
// gas legacy: 111806
|
||||||
// gas legacyOptimized: 111122
|
// gas legacyOptimized: 111122
|
||||||
|
@ -21,5 +21,5 @@ contract c {
|
|||||||
// ----
|
// ----
|
||||||
// test() -> 2, 3, 4, 5
|
// test() -> 2, 3, 4, 5
|
||||||
// gas irOptimized: 135082
|
// gas irOptimized: 135082
|
||||||
// gas legacy: 147443
|
// gas legacy: 147439
|
||||||
// gas legacyOptimized: 146434
|
// gas legacyOptimized: 146434
|
||||||
|
@ -25,5 +25,5 @@ contract Main {
|
|||||||
// ----
|
// ----
|
||||||
// f(uint256): 0x34 -> 0x46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1
|
// f(uint256): 0x34 -> 0x46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1
|
||||||
// gas irOptimized: 111924
|
// gas irOptimized: 111924
|
||||||
// gas legacy: 125162
|
// gas legacy: 125160
|
||||||
// gas legacyOptimized: 113012
|
// gas legacyOptimized: 113612
|
||||||
|
@ -30,7 +30,7 @@ contract C {
|
|||||||
// constructor() ->
|
// constructor() ->
|
||||||
// gas irOptimized: 442530
|
// gas irOptimized: 442530
|
||||||
// gas legacy: 711299
|
// gas legacy: 711299
|
||||||
// gas legacyOptimized: 481296
|
// gas legacyOptimized: 481944
|
||||||
// h() -> 0x20, 0x40, 0x00, 0
|
// h() -> 0x20, 0x40, 0x00, 0
|
||||||
// ~ emit ev(uint256[],uint256): 0x40, 0x21, 0x02, 0x00, 0x00
|
// ~ emit ev(uint256[],uint256): 0x40, 0x21, 0x02, 0x00, 0x00
|
||||||
// g() -> 0x20, 0x40, 0, 0x00
|
// g() -> 0x20, 0x40, 0, 0x00
|
||||||
|
@ -9,7 +9,7 @@ contract c {
|
|||||||
// EVMVersion: >=byzantium
|
// EVMVersion: >=byzantium
|
||||||
// ----
|
// ----
|
||||||
// (): 1, 2, 3, 4, 5 ->
|
// (): 1, 2, 3, 4, 5 ->
|
||||||
// gas irOptimized: 155131
|
// gas irOptimized: 155128
|
||||||
// gas legacy: 155473
|
// gas legacy: 155473
|
||||||
// gas legacyOptimized: 155298
|
// gas legacyOptimized: 155298
|
||||||
// checkIfDataIsEmpty() -> false
|
// checkIfDataIsEmpty() -> false
|
||||||
|
@ -26,4 +26,4 @@ contract Creator {
|
|||||||
// f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8
|
// f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8
|
||||||
// gas irOptimized: 424508
|
// gas irOptimized: 424508
|
||||||
// gas legacy: 581443
|
// gas legacy: 581443
|
||||||
// gas legacyOptimized: 444588
|
// gas legacyOptimized: 445191
|
||||||
|
@ -26,4 +26,4 @@ contract Creator {
|
|||||||
// f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h"
|
// f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h"
|
||||||
// gas irOptimized: 275487
|
// gas irOptimized: 275487
|
||||||
// gas legacy: 418462
|
// gas legacy: 418462
|
||||||
// gas legacyOptimized: 291760
|
// gas legacyOptimized: 292366
|
||||||
|
@ -10,6 +10,6 @@ contract Test {
|
|||||||
// constructor(): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" ->
|
// constructor(): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" ->
|
||||||
// gas irOptimized: 268145
|
// gas irOptimized: 268145
|
||||||
// gas legacy: 311324
|
// gas legacy: 311324
|
||||||
// gas legacyOptimized: 258388
|
// gas legacyOptimized: 259036
|
||||||
// m_x() -> 7
|
// m_x() -> 7
|
||||||
// m_s() -> 0x20, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz"
|
// m_s() -> 0x20, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz"
|
||||||
|
@ -19,6 +19,6 @@ contract Main {
|
|||||||
// constructor(): "abc", true
|
// constructor(): "abc", true
|
||||||
// gas irOptimized: 104394
|
// gas irOptimized: 104394
|
||||||
// gas legacy: 143300
|
// gas legacy: 143300
|
||||||
// gas legacyOptimized: 102961
|
// gas legacyOptimized: 103609
|
||||||
// getFlag() -> true
|
// getFlag() -> true
|
||||||
// getName() -> "abc"
|
// getName() -> "abc"
|
||||||
|
@ -11,7 +11,7 @@ contract C {
|
|||||||
// constructor(): 1, 2, 3, 4 ->
|
// constructor(): 1, 2, 3, 4 ->
|
||||||
// gas irOptimized: 170999
|
// gas irOptimized: 170999
|
||||||
// gas legacy: 218378
|
// gas legacy: 218378
|
||||||
// gas legacyOptimized: 176195
|
// gas legacyOptimized: 176843
|
||||||
// a() -> 1
|
// a() -> 1
|
||||||
// b(uint256): 0 -> 2
|
// b(uint256): 0 -> 2
|
||||||
// b(uint256): 1 -> 3
|
// b(uint256): 1 -> 3
|
||||||
|
@ -11,5 +11,5 @@ contract B is A {
|
|||||||
// constructor() ->
|
// constructor() ->
|
||||||
// gas irOptimized: 119640
|
// gas irOptimized: 119640
|
||||||
// gas legacy: 133594
|
// gas legacy: 133594
|
||||||
// gas legacyOptimized: 115341
|
// gas legacyOptimized: 115989
|
||||||
// y() -> 42
|
// y() -> 42
|
||||||
|
@ -23,7 +23,7 @@ contract D is B, C {
|
|||||||
// constructor(): 2, 0 ->
|
// constructor(): 2, 0 ->
|
||||||
// gas irOptimized: 151966
|
// gas irOptimized: 151966
|
||||||
// gas legacy: 168623
|
// gas legacy: 168623
|
||||||
// gas legacyOptimized: 144577
|
// gas legacyOptimized: 145225
|
||||||
// i() -> 2
|
// i() -> 2
|
||||||
// j() -> 2
|
// j() -> 2
|
||||||
// k() -> 1
|
// k() -> 1
|
||||||
|
@ -14,6 +14,6 @@ contract D is C {
|
|||||||
// constructor(): 2, 0 ->
|
// constructor(): 2, 0 ->
|
||||||
// gas irOptimized: 121805
|
// gas irOptimized: 121805
|
||||||
// gas legacy: 137193
|
// gas legacy: 137193
|
||||||
// gas legacyOptimized: 118548
|
// gas legacyOptimized: 119196
|
||||||
// i() -> 2
|
// i() -> 2
|
||||||
// k() -> 1
|
// k() -> 1
|
||||||
|
@ -14,5 +14,5 @@ contract C {
|
|||||||
// createEvent(uint256): 42 ->
|
// createEvent(uint256): 42 ->
|
||||||
// ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c
|
// ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c
|
||||||
// gas irOptimized: 113485
|
// gas irOptimized: 113485
|
||||||
// gas legacy: 116314
|
// gas legacy: 116313
|
||||||
// gas legacyOptimized: 114407
|
// gas legacyOptimized: 114407
|
||||||
|
@ -15,5 +15,5 @@ contract C {
|
|||||||
// createEvent(uint256): 42 ->
|
// createEvent(uint256): 42 ->
|
||||||
// ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c
|
// ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c
|
||||||
// gas irOptimized: 113485
|
// gas irOptimized: 113485
|
||||||
// gas legacy: 116314
|
// gas legacy: 116313
|
||||||
// gas legacyOptimized: 114407
|
// gas legacyOptimized: 114407
|
||||||
|
@ -16,5 +16,5 @@ contract C {
|
|||||||
// createEvent(uint256): 42 ->
|
// createEvent(uint256): 42 ->
|
||||||
// ~ emit E(uint256[][]): 0x20, 0x02, 0x40, 0xa0, 0x02, 0x2a, 0x2b, 0x02, 0x2c, 0x2d
|
// ~ emit E(uint256[][]): 0x20, 0x02, 0x40, 0xa0, 0x02, 0x2a, 0x2b, 0x02, 0x2c, 0x2d
|
||||||
// gas irOptimized: 185033
|
// gas irOptimized: 185033
|
||||||
// gas legacy: 187495
|
// gas legacy: 187493
|
||||||
// gas legacyOptimized: 184525
|
// gas legacyOptimized: 184525
|
||||||
|
@ -16,7 +16,7 @@ contract C {
|
|||||||
// ----
|
// ----
|
||||||
// constructor() ->
|
// constructor() ->
|
||||||
// gas irOptimized: 165398
|
// gas irOptimized: 165398
|
||||||
// gas legacy: 244800
|
// gas legacy: 244799
|
||||||
// gas legacyOptimized: 171615
|
// gas legacyOptimized: 172920
|
||||||
// deposit(bytes32), 18 wei: 0x1234 ->
|
// deposit(bytes32), 18 wei: 0x1234 ->
|
||||||
// ~ emit Deposit(address,bytes32,uint256) from 0x137aa4dfc0911524504fcd4d98501f179bc13b4a: #0xc06afe3a8444fc0004668591e8306bfb9968e79e, #0x1234, 0x00
|
// ~ emit Deposit(address,bytes32,uint256) from 0x137aa4dfc0911524504fcd4d98501f179bc13b4a: #0xc06afe3a8444fc0004668591e8306bfb9968e79e, #0x1234, 0x00
|
||||||
|
@ -76,7 +76,7 @@ contract FixedFeeRegistrar is Registrar {
|
|||||||
// constructor()
|
// constructor()
|
||||||
// gas irOptimized: 384610
|
// gas irOptimized: 384610
|
||||||
// gas legacy: 913421
|
// gas legacy: 913421
|
||||||
// gas legacyOptimized: 476928
|
// gas legacyOptimized: 477576
|
||||||
// reserve(string), 69 ether: 0x20, 3, "abc" ->
|
// reserve(string), 69 ether: 0x20, 3, "abc" ->
|
||||||
// ~ emit Changed(string): #0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45
|
// ~ emit Changed(string): #0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45
|
||||||
// gas irOptimized: 45967
|
// gas irOptimized: 45967
|
||||||
|
@ -35,7 +35,7 @@ contract test {
|
|||||||
// constructor()
|
// constructor()
|
||||||
// gas irOptimized: 406907
|
// gas irOptimized: 406907
|
||||||
// gas legacy: 737652
|
// gas legacy: 737652
|
||||||
// gas legacyOptimized: 526820
|
// gas legacyOptimized: 527468
|
||||||
// encode_inline_asm(bytes): 0x20, 0 -> 0x20, 0
|
// encode_inline_asm(bytes): 0x20, 0 -> 0x20, 0
|
||||||
// encode_inline_asm(bytes): 0x20, 1, "f" -> 0x20, 4, "Zg=="
|
// encode_inline_asm(bytes): 0x20, 1, "f" -> 0x20, 4, "Zg=="
|
||||||
// encode_inline_asm(bytes): 0x20, 2, "fo" -> 0x20, 4, "Zm8="
|
// encode_inline_asm(bytes): 0x20, 2, "fo" -> 0x20, 4, "Zm8="
|
||||||
@ -56,5 +56,5 @@ contract test {
|
|||||||
// gas legacyOptimized: 1199031
|
// gas legacyOptimized: 1199031
|
||||||
// encode_no_asm_large()
|
// encode_no_asm_large()
|
||||||
// gas irOptimized: 3276081
|
// gas irOptimized: 3276081
|
||||||
// gas legacy: 4705075
|
// gas legacy: 4704075
|
||||||
// gas legacyOptimized: 2890075
|
// gas legacyOptimized: 2890075
|
||||||
|
@ -178,7 +178,7 @@ contract DepositContract is IDepositContract, ERC165 {
|
|||||||
// constructor()
|
// constructor()
|
||||||
// gas irOptimized: 1391860
|
// gas irOptimized: 1391860
|
||||||
// gas legacy: 2391952
|
// gas legacy: 2391952
|
||||||
// gas legacyOptimized: 1752320
|
// gas legacyOptimized: 1752944
|
||||||
// supportsInterface(bytes4): 0x0 -> 0
|
// supportsInterface(bytes4): 0x0 -> 0
|
||||||
// supportsInterface(bytes4): 0xffffffff00000000000000000000000000000000000000000000000000000000 -> false # defined to be false by ERC-165 #
|
// supportsInterface(bytes4): 0xffffffff00000000000000000000000000000000000000000000000000000000 -> false # defined to be false by ERC-165 #
|
||||||
// supportsInterface(bytes4): 0x01ffc9a700000000000000000000000000000000000000000000000000000000 -> true # ERC-165 id #
|
// supportsInterface(bytes4): 0x01ffc9a700000000000000000000000000000000000000000000000000000000 -> true # ERC-165 id #
|
||||||
|
@ -50,7 +50,7 @@ contract test {
|
|||||||
// constructor()
|
// constructor()
|
||||||
// gas irOptimized: 1849535
|
// gas irOptimized: 1849535
|
||||||
// gas legacy: 2430726
|
// gas legacy: 2430726
|
||||||
// gas legacyOptimized: 1854979
|
// gas legacyOptimized: 1855646
|
||||||
// div(int256,int256): 3141592653589793238, 88714123 -> 35412542528203691288251815328
|
// div(int256,int256): 3141592653589793238, 88714123 -> 35412542528203691288251815328
|
||||||
// gas irOptimized: 22137
|
// gas irOptimized: 22137
|
||||||
// gas legacy: 22767
|
// gas legacy: 22767
|
||||||
|
@ -50,7 +50,7 @@ contract test {
|
|||||||
// constructor()
|
// constructor()
|
||||||
// gas irOptimized: 1723666
|
// gas irOptimized: 1723666
|
||||||
// gas legacy: 2210160
|
// gas legacy: 2210160
|
||||||
// gas legacyOptimized: 1734152
|
// gas legacyOptimized: 1734788
|
||||||
// div(uint256,uint256): 3141592653589793238, 88714123 -> 35412542528203691288251815328
|
// div(uint256,uint256): 3141592653589793238, 88714123 -> 35412542528203691288251815328
|
||||||
// gas irOptimized: 22004
|
// gas irOptimized: 22004
|
||||||
// gas legacy: 22497
|
// gas legacy: 22497
|
||||||
|
@ -35,7 +35,7 @@ contract test {
|
|||||||
// constructor()
|
// constructor()
|
||||||
// gas irOptimized: 407075
|
// gas irOptimized: 407075
|
||||||
// gas legacy: 631753
|
// gas legacy: 631753
|
||||||
// gas legacyOptimized: 459425
|
// gas legacyOptimized: 460073
|
||||||
// prb_pi() -> 3141592656369545286
|
// prb_pi() -> 3141592656369545286
|
||||||
// gas irOptimized: 57478
|
// gas irOptimized: 57478
|
||||||
// gas legacy: 101655
|
// gas legacy: 101655
|
||||||
|
@ -296,7 +296,7 @@ contract Test {
|
|||||||
// pair() -> true
|
// pair() -> true
|
||||||
// gas irOptimized: 269901
|
// gas irOptimized: 269901
|
||||||
// gas legacy: 275678
|
// gas legacy: 275678
|
||||||
// gas legacyOptimized: 267193
|
// gas legacyOptimized: 267130
|
||||||
// verifyTx() -> true
|
// verifyTx() -> true
|
||||||
// ~ emit Verified(string): 0x20, 0x16, "Successfully verified."
|
// ~ emit Verified(string): 0x20, 0x16, "Successfully verified."
|
||||||
// gas irOptimized: 783281
|
// gas irOptimized: 783281
|
||||||
|
@ -51,7 +51,7 @@ contract test {
|
|||||||
// constructor()
|
// constructor()
|
||||||
// gas irOptimized: 633020
|
// gas irOptimized: 633020
|
||||||
// gas legacy: 1065857
|
// gas legacy: 1065857
|
||||||
// gas legacyOptimized: 725207
|
// gas legacyOptimized: 725867
|
||||||
// toSlice(string): 0x20, 11, "hello world" -> 11, 0xa0
|
// toSlice(string): 0x20, 11, "hello world" -> 11, 0xa0
|
||||||
// gas irOptimized: 22660
|
// gas irOptimized: 22660
|
||||||
// gas legacy: 23190
|
// gas legacy: 23190
|
||||||
|
@ -17,5 +17,5 @@ contract D {
|
|||||||
// constructor(): 2 ->
|
// constructor(): 2 ->
|
||||||
// gas irOptimized: 193567
|
// gas irOptimized: 193567
|
||||||
// gas legacy: 241234
|
// gas legacy: 241234
|
||||||
// gas legacyOptimized: 192961
|
// gas legacyOptimized: 194257
|
||||||
// f() -> 2
|
// f() -> 2
|
||||||
|
@ -19,5 +19,5 @@ contract D {
|
|||||||
// constructor(): 2 ->
|
// constructor(): 2 ->
|
||||||
// gas irOptimized: 193730
|
// gas irOptimized: 193730
|
||||||
// gas legacy: 241606
|
// gas legacy: 241606
|
||||||
// gas legacyOptimized: 193193
|
// gas legacyOptimized: 194489
|
||||||
// f() -> 2
|
// f() -> 2
|
||||||
|
@ -24,7 +24,7 @@ contract C {
|
|||||||
// constructor(), 1 ether ->
|
// constructor(), 1 ether ->
|
||||||
// gas irOptimized: 265110
|
// gas irOptimized: 265110
|
||||||
// gas legacy: 441442
|
// gas legacy: 441442
|
||||||
// gas legacyOptimized: 292862
|
// gas legacyOptimized: 293510
|
||||||
// f(uint256): 0 -> FAILURE
|
// f(uint256): 0 -> FAILURE
|
||||||
// f(uint256): 1 -> FAILURE
|
// f(uint256): 1 -> FAILURE
|
||||||
// f(uint256): 2 -> FAILURE
|
// f(uint256): 2 -> FAILURE
|
||||||
|
@ -19,7 +19,7 @@ contract C {
|
|||||||
// constructor(), 20 wei
|
// constructor(), 20 wei
|
||||||
// gas irOptimized: 171806
|
// gas irOptimized: 171806
|
||||||
// gas legacy: 285547
|
// gas legacy: 285547
|
||||||
// gas legacyOptimized: 168515
|
// gas legacyOptimized: 169163
|
||||||
// f(uint256): 20 -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a
|
// f(uint256): 20 -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a
|
||||||
// x() -> 1
|
// x() -> 1
|
||||||
// f(uint256): 20 -> FAILURE
|
// f(uint256): 20 -> FAILURE
|
||||||
|
@ -39,8 +39,8 @@ contract test {
|
|||||||
// ----
|
// ----
|
||||||
// constructor(), 20 wei ->
|
// constructor(), 20 wei ->
|
||||||
// gas irOptimized: 253950
|
// gas irOptimized: 253950
|
||||||
// gas legacy: 391588
|
// gas legacy: 391587
|
||||||
// gas legacyOptimized: 268089
|
// gas legacyOptimized: 269385
|
||||||
// sendAmount(uint256): 5 -> 5
|
// sendAmount(uint256): 5 -> 5
|
||||||
// outOfGas() -> FAILURE # call to helper should not succeed but amount should be transferred anyway #
|
// outOfGas() -> FAILURE # call to helper should not succeed but amount should be transferred anyway #
|
||||||
// checkState() -> false, 15
|
// checkState() -> false, 15
|
||||||
|
@ -38,8 +38,8 @@ contract test {
|
|||||||
// ----
|
// ----
|
||||||
// constructor(), 20 wei ->
|
// constructor(), 20 wei ->
|
||||||
// gas irOptimized: 253950
|
// gas irOptimized: 253950
|
||||||
// gas legacy: 391588
|
// gas legacy: 391587
|
||||||
// gas legacyOptimized: 268089
|
// gas legacyOptimized: 269385
|
||||||
// sendAmount(uint256): 5 -> 5
|
// sendAmount(uint256): 5 -> 5
|
||||||
// outOfGas() -> FAILURE # call to helper should not succeed but amount should be transferred anyway #
|
// outOfGas() -> FAILURE # call to helper should not succeed but amount should be transferred anyway #
|
||||||
// checkState() -> false, 15
|
// checkState() -> false, 15
|
||||||
|
@ -27,4 +27,4 @@ contract C {
|
|||||||
// t() -> 9
|
// t() -> 9
|
||||||
// gas irOptimized: 99064
|
// gas irOptimized: 99064
|
||||||
// gas legacy: 149095
|
// gas legacy: 149095
|
||||||
// gas legacyOptimized: 106188
|
// gas legacyOptimized: 106788
|
||||||
|
@ -29,6 +29,6 @@ contract C {
|
|||||||
// f() -> 3, 7, 5
|
// f() -> 3, 7, 5
|
||||||
// gas irOptimized: 124024
|
// gas irOptimized: 124024
|
||||||
// gas legacy: 148528
|
// gas legacy: 148528
|
||||||
// gas legacyOptimized: 123971
|
// gas legacyOptimized: 125171
|
||||||
// x() -> 7
|
// x() -> 7
|
||||||
// y() -> 5
|
// y() -> 5
|
||||||
|
@ -16,7 +16,7 @@ contract C {
|
|||||||
// ----
|
// ----
|
||||||
// constructor(): 3 ->
|
// constructor(): 3 ->
|
||||||
// gas irOptimized: 123542
|
// gas irOptimized: 123542
|
||||||
// gas legacy: 197645
|
// gas legacy: 197644
|
||||||
// gas legacyOptimized: 137678
|
// gas legacyOptimized: 138326
|
||||||
// f() -> 84, 23
|
// f() -> 84, 23
|
||||||
// m(uint256): 3 -> 7
|
// m(uint256): 3 -> 7
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user