mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Skip extcodesize check if return data is expected.
This commit is contained in:
parent
ea3c34a082
commit
a1aa9d2d90
@ -5,6 +5,7 @@ Language Features:
|
||||
|
||||
|
||||
Compiler Features:
|
||||
* Code Generator: Skip existence check for external contract if return data is expected. In this case, the ABI decoder will revert if the contract does not exist.
|
||||
* Commandline Interface: Accept nested brackets in step sequences passed to ``--yul-optimizations``.
|
||||
* Commandline Interface: Add ``--debug-info`` option for selecting how much extra debug information should be included in the produced EVM assembly and Yul code.
|
||||
* Commandline Interface: Use different colors when printing errors, warnings and infos.
|
||||
|
@ -2630,9 +2630,21 @@ void ExpressionCompiler::appendExternalFunctionCall(
|
||||
// Check the target contract exists (has code) for non-low-level calls.
|
||||
if (funKind == FunctionType::Kind::External || funKind == FunctionType::Kind::DelegateCall)
|
||||
{
|
||||
m_context << Instruction::DUP1 << Instruction::EXTCODESIZE << Instruction::ISZERO;
|
||||
m_context.appendConditionalRevert(false, "Target contract does not contain code");
|
||||
existenceChecked = true;
|
||||
size_t encodedHeadSize = 0;
|
||||
for (auto const& t: returnTypes)
|
||||
encodedHeadSize += t->decodingType()->calldataHeadSize();
|
||||
// We do not need to check extcodesize if we expect return data, since if there is no
|
||||
// code, the call will return empty data and the ABI decoder will revert.
|
||||
if (
|
||||
encodedHeadSize == 0 ||
|
||||
!haveReturndatacopy ||
|
||||
m_context.revertStrings() >= RevertStrings::Debug
|
||||
)
|
||||
{
|
||||
m_context << Instruction::DUP1 << Instruction::EXTCODESIZE << Instruction::ISZERO;
|
||||
m_context.appendConditionalRevert(false, "Target contract does not contain code");
|
||||
existenceChecked = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (_functionType.gasSet())
|
||||
|
@ -2451,8 +2451,10 @@ void IRGeneratorForStatements::appendExternalFunctionCall(
|
||||
appendCode() << "mstore(add(" << m_utils.allocateUnboundedFunction() << "() , " << to_string(returnInfo.estimatedReturnSize) << "), 0)\n";
|
||||
}
|
||||
|
||||
Whiskers templ(R"(if iszero(extcodesize(<address>)) { <revertNoCode>() }
|
||||
|
||||
Whiskers templ(R"(
|
||||
<?checkExtcodesize>
|
||||
if iszero(extcodesize(<address>)) { <revertNoCode>() }
|
||||
</checkExtcodesize>
|
||||
// storage for arguments and returned data
|
||||
let <pos> := <allocateUnbounded>()
|
||||
mstore(<pos>, <shl28>(<funSel>))
|
||||
@ -2477,6 +2479,18 @@ void IRGeneratorForStatements::appendExternalFunctionCall(
|
||||
}
|
||||
)");
|
||||
templ("revertNoCode", m_utils.revertReasonIfDebugFunction("Target contract does not contain code"));
|
||||
|
||||
// We do not need to check extcodesize if we expect return data: If there is no
|
||||
// code, the call will return empty data and the ABI decoder will revert.
|
||||
size_t encodedHeadSize = 0;
|
||||
for (auto const& t: returnInfo.returnTypes)
|
||||
encodedHeadSize += t->decodingType()->calldataHeadSize();
|
||||
bool const checkExtcodesize =
|
||||
encodedHeadSize == 0 ||
|
||||
!m_context.evmVersion().supportsReturndata() ||
|
||||
m_context.revertStrings() >= RevertStrings::Debug;
|
||||
templ("checkExtcodesize", checkExtcodesize);
|
||||
|
||||
templ("pos", m_context.newYulVariable());
|
||||
templ("end", m_context.newYulVariable());
|
||||
if (_functionCall.annotation().tryCall)
|
||||
@ -2532,6 +2546,8 @@ void IRGeneratorForStatements::appendExternalFunctionCall(
|
||||
u256 gasNeededByCaller = evmasm::GasCosts::callGas(m_context.evmVersion()) + 10;
|
||||
if (funType.valueSet())
|
||||
gasNeededByCaller += evmasm::GasCosts::callValueTransferGas;
|
||||
if (!checkExtcodesize)
|
||||
gasNeededByCaller += evmasm::GasCosts::callNewAccountGas; // we never know
|
||||
templ("gas", "sub(gas(), " + formatNumber(gasNeededByCaller) + ")");
|
||||
}
|
||||
// Order is important here, STATICCALL might overlap with DELEGATECALL.
|
||||
|
@ -289,6 +289,19 @@ sub_0: assembly {
|
||||
address
|
||||
/* \"C\":403:411 this.f() */
|
||||
extcodesize
|
||||
tag_40
|
||||
jumpi
|
||||
/* \"C\":79:428 contract C... */
|
||||
dup2
|
||||
dup3
|
||||
revert
|
||||
/* \"C\":403:411 this.f() */
|
||||
tag_40:
|
||||
/* \"C\":79:428 contract C... */
|
||||
/* \"C\":403:407 this */
|
||||
address
|
||||
/* \"C\":403:411 this.f() */
|
||||
extcodesize
|
||||
iszero
|
||||
tag_43
|
||||
jumpi
|
||||
@ -316,6 +329,8 @@ sub_0: assembly {
|
||||
tag_45
|
||||
jumpi
|
||||
dup1
|
||||
tag_41
|
||||
tag_40
|
||||
swap3
|
||||
tag_47
|
||||
jumpi
|
||||
@ -344,12 +359,22 @@ sub_0: assembly {
|
||||
swap1
|
||||
jump\t// out
|
||||
/* \"C\":403:411 this.f() */
|
||||
tag_41:
|
||||
tag_40:
|
||||
tag_47:
|
||||
/* \"C\":79:428 contract C... */
|
||||
swap1
|
||||
swap2
|
||||
pop
|
||||
/* \"C\":403:411 this.f() */
|
||||
dup2
|
||||
iszero
|
||||
tag_42
|
||||
jumpi
|
||||
dup2
|
||||
iszero
|
||||
tag_41
|
||||
jumpi
|
||||
returndatasize
|
||||
/* \"C\":79:428 contract C... */
|
||||
0x1f
|
||||
@ -366,6 +391,10 @@ sub_0: assembly {
|
||||
dup4
|
||||
lt
|
||||
or
|
||||
iszero
|
||||
tag_43
|
||||
iszero
|
||||
tag_42
|
||||
tag_51
|
||||
jumpi
|
||||
pop
|
||||
@ -379,26 +408,56 @@ sub_0: assembly {
|
||||
/* \"C\":392:422 stateVar + this.f() + immutVar */
|
||||
tag_50
|
||||
/* \"C\":79:428 contract C... */
|
||||
mstore
|
||||
0x24
|
||||
dup7
|
||||
revert
|
||||
tag_43:
|
||||
mstore
|
||||
0x24
|
||||
dup7
|
||||
revert
|
||||
tag_42:
|
||||
swap5
|
||||
0x40
|
||||
mstore
|
||||
/* \"C\":403:411 this.f() */
|
||||
tag_44
|
||||
tag_43
|
||||
returndatasize
|
||||
dup2
|
||||
add
|
||||
swap1
|
||||
tag_7
|
||||
jump\t// in
|
||||
tag_44:
|
||||
swap1
|
||||
tag_43:
|
||||
swap1
|
||||
tag_53:
|
||||
swap2
|
||||
dup2
|
||||
swap4
|
||||
pop
|
||||
tag_42:
|
||||
/* \"C\":392:411 stateVar + this.f() */
|
||||
tag_45
|
||||
tag_41:
|
||||
/* \"C\":392:411 stateVar + this.f() */
|
||||
tag_44
|
||||
jump(tag_48)
|
||||
/* \"C\":79:428 contract C... */
|
||||
tag_51:
|
||||
shl(0xe0, 0x4e487b71)
|
||||
dup2
|
||||
dup6
|
||||
tag_5
|
||||
jump\t// in
|
||||
tag_45:
|
||||
dup6
|
||||
tag_5
|
||||
jump\t// in
|
||||
tag_44:
|
||||
mstore
|
||||
0x41
|
||||
/* \"C\":403:411 this.f() */
|
||||
@ -422,12 +481,30 @@ sub_0: assembly {
|
||||
pop
|
||||
pop
|
||||
pop
|
||||
/* \"C\":392:422 stateVar + this.f() + immutVar */
|
||||
tag_46
|
||||
/* \"C\":414:422 immutVar */
|
||||
immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\")
|
||||
/* \"C\":392:422 stateVar + this.f() + immutVar */
|
||||
/* \"C\":392:422 stateVar + this.f() + immutVar */
|
||||
tag_45
|
||||
/* \"C\":414:422 immutVar */
|
||||
immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\")
|
||||
/* \"C\":392:422 stateVar + this.f() + immutVar */
|
||||
pop
|
||||
mload(0x40)
|
||||
swap1
|
||||
returndatasize
|
||||
swap1
|
||||
dup3
|
||||
tag_5
|
||||
jump\t// in
|
||||
tag_46:
|
||||
/* \"C\":336:337 _ */
|
||||
tag_5
|
||||
jump\t// in
|
||||
tag_45:
|
||||
/* \"C\":336:337 _ */
|
||||
returndatacopy
|
||||
returndatasize
|
||||
swap1
|
||||
@ -453,6 +530,10 @@ sub_0: assembly {
|
||||
swap2
|
||||
sub
|
||||
slt
|
||||
iszero
|
||||
tag_48
|
||||
iszero
|
||||
tag_47
|
||||
tag_55
|
||||
jumpi
|
||||
mload
|
||||
@ -464,6 +545,20 @@ sub_0: assembly {
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_48:
|
||||
pop
|
||||
mload
|
||||
swap2
|
||||
swap1
|
||||
pop
|
||||
jump\t// out
|
||||
tag_47:
|
||||
pop
|
||||
mload
|
||||
swap2
|
||||
swap1
|
||||
pop
|
||||
jump\t// out
|
||||
|
||||
auxdata: <AUXDATA REMOVED>
|
||||
}
|
||||
@ -799,6 +894,19 @@ sub_0: assembly {
|
||||
address
|
||||
/* \"C\":403:411 this.f() */
|
||||
extcodesize
|
||||
tag_40
|
||||
jumpi
|
||||
/* \"D\":91:166 contract D is C(3)... */
|
||||
dup2
|
||||
dup3
|
||||
revert
|
||||
/* \"C\":403:411 this.f() */
|
||||
tag_40:
|
||||
/* \"D\":91:166 contract D is C(3)... */
|
||||
/* \"C\":403:407 this */
|
||||
address
|
||||
/* \"C\":403:411 this.f() */
|
||||
extcodesize
|
||||
iszero
|
||||
tag_43
|
||||
jumpi
|
||||
@ -826,6 +934,8 @@ sub_0: assembly {
|
||||
tag_45
|
||||
jumpi
|
||||
dup1
|
||||
tag_41
|
||||
tag_40
|
||||
swap3
|
||||
tag_47
|
||||
jumpi
|
||||
@ -854,12 +964,22 @@ sub_0: assembly {
|
||||
swap1
|
||||
jump\t// out
|
||||
/* \"C\":403:411 this.f() */
|
||||
tag_41:
|
||||
tag_40:
|
||||
tag_47:
|
||||
/* \"D\":91:166 contract D is C(3)... */
|
||||
swap1
|
||||
swap2
|
||||
pop
|
||||
/* \"C\":403:411 this.f() */
|
||||
dup2
|
||||
iszero
|
||||
tag_42
|
||||
jumpi
|
||||
dup2
|
||||
iszero
|
||||
tag_41
|
||||
jumpi
|
||||
returndatasize
|
||||
/* \"D\":91:166 contract D is C(3)... */
|
||||
0x1f
|
||||
@ -876,6 +996,10 @@ sub_0: assembly {
|
||||
dup4
|
||||
lt
|
||||
or
|
||||
iszero
|
||||
tag_43
|
||||
iszero
|
||||
tag_42
|
||||
tag_51
|
||||
jumpi
|
||||
pop
|
||||
@ -889,26 +1013,56 @@ sub_0: assembly {
|
||||
/* \"C\":392:422 stateVar + this.f() + immutVar */
|
||||
tag_50
|
||||
/* \"D\":91:166 contract D is C(3)... */
|
||||
mstore
|
||||
0x24
|
||||
dup7
|
||||
revert
|
||||
tag_43:
|
||||
mstore
|
||||
0x24
|
||||
dup7
|
||||
revert
|
||||
tag_42:
|
||||
swap5
|
||||
0x40
|
||||
mstore
|
||||
/* \"C\":403:411 this.f() */
|
||||
tag_44
|
||||
tag_43
|
||||
returndatasize
|
||||
dup2
|
||||
add
|
||||
swap1
|
||||
tag_7
|
||||
jump\t// in
|
||||
tag_44:
|
||||
swap1
|
||||
tag_43:
|
||||
swap1
|
||||
tag_53:
|
||||
swap2
|
||||
dup2
|
||||
swap4
|
||||
pop
|
||||
tag_42:
|
||||
/* \"C\":392:411 stateVar + this.f() */
|
||||
tag_45
|
||||
tag_41:
|
||||
/* \"C\":392:411 stateVar + this.f() */
|
||||
tag_44
|
||||
jump(tag_48)
|
||||
/* \"D\":91:166 contract D is C(3)... */
|
||||
tag_51:
|
||||
shl(0xe0, 0x4e487b71)
|
||||
dup2
|
||||
dup6
|
||||
tag_5
|
||||
jump\t// in
|
||||
tag_45:
|
||||
dup6
|
||||
tag_5
|
||||
jump\t// in
|
||||
tag_44:
|
||||
mstore
|
||||
0x41
|
||||
/* \"C\":403:411 this.f() */
|
||||
@ -931,6 +1085,16 @@ sub_0: assembly {
|
||||
swap4
|
||||
pop
|
||||
pop
|
||||
/* \"C\":392:422 stateVar + this.f() + immutVar */
|
||||
tag_46
|
||||
/* \"C\":414:422 immutVar */
|
||||
immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\")
|
||||
/* \"C\":392:422 stateVar + this.f() + immutVar */
|
||||
/* \"C\":392:422 stateVar + this.f() + immutVar */
|
||||
tag_45
|
||||
/* \"C\":414:422 immutVar */
|
||||
immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\")
|
||||
/* \"C\":392:422 stateVar + this.f() + immutVar */
|
||||
pop
|
||||
pop
|
||||
mload(0x40)
|
||||
@ -938,6 +1102,14 @@ sub_0: assembly {
|
||||
returndatasize
|
||||
swap1
|
||||
dup3
|
||||
tag_5
|
||||
jump\t// in
|
||||
tag_46:
|
||||
/* \"C\":336:337 _ */
|
||||
tag_5
|
||||
jump\t// in
|
||||
tag_45:
|
||||
/* \"C\":336:337 _ */
|
||||
returndatacopy
|
||||
returndatasize
|
||||
swap1
|
||||
@ -963,6 +1135,10 @@ sub_0: assembly {
|
||||
swap2
|
||||
sub
|
||||
slt
|
||||
iszero
|
||||
tag_48
|
||||
iszero
|
||||
tag_47
|
||||
tag_55
|
||||
jumpi
|
||||
mload
|
||||
@ -974,6 +1150,20 @@ sub_0: assembly {
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_48:
|
||||
pop
|
||||
mload
|
||||
swap2
|
||||
swap1
|
||||
pop
|
||||
jump\t// out
|
||||
tag_47:
|
||||
pop
|
||||
mload
|
||||
swap2
|
||||
swap1
|
||||
pop
|
||||
jump\t// out
|
||||
|
||||
auxdata: <AUXDATA REMOVED>
|
||||
}
|
||||
|
@ -526,7 +526,6 @@ object \"C_54\" {
|
||||
let expr_46_address := convert_t_contract$_C_$54_to_t_address(expr_45_address)
|
||||
let expr_46_functionSelector := 0x26121ff0
|
||||
/// @src 0:410:418 \"this.f()\"
|
||||
if iszero(extcodesize(expr_46_address)) { revert_error_0cc013b6b3b6beabea4e3a74a6d380f0df81852ca99887912475e1f66b2a2c20() }
|
||||
|
||||
// storage for arguments and returned data
|
||||
let _10 := allocate_unbounded()
|
||||
@ -640,7 +639,7 @@ object \"C_54\" {
|
||||
case 0x26121ff0 {
|
||||
if callvalue() { revert(_1, _1) }
|
||||
abi_decode(calldatasize())
|
||||
let ret := /** @src 0:286:305 \"constVar + immutVar\" */ checked_add_int256_566(/** @src 0:297:305 \"immutVar\" */ loadimmutable(\"8\"))
|
||||
let ret := /** @src 0:286:305 \"constVar + immutVar\" */ checked_add_int256_556(/** @src 0:297:305 \"immutVar\" */ loadimmutable(\"8\"))
|
||||
/// @src 0:79:435 \"contract C...\"
|
||||
let memPos := mload(64)
|
||||
return(memPos, sub(abi_encode_int256(memPos, ret), memPos))
|
||||
@ -664,7 +663,7 @@ object \"C_54\" {
|
||||
if callvalue() { revert(_1, _1) }
|
||||
abi_decode(calldatasize())
|
||||
let memPos_3 := mload(64)
|
||||
return(memPos_3, sub(abi_encode_int256_565(memPos_3), memPos_3))
|
||||
return(memPos_3, sub(abi_encode_int256_555(memPos_3), memPos_3))
|
||||
}
|
||||
}
|
||||
revert(0, 0)
|
||||
@ -673,7 +672,7 @@ object \"C_54\" {
|
||||
{
|
||||
if slt(add(dataEnd, not(3)), 0) { revert(0, 0) }
|
||||
}
|
||||
function abi_encode_int256_565(headStart) -> tail
|
||||
function abi_encode_int256_555(headStart) -> tail
|
||||
{
|
||||
tail := add(headStart, 32)
|
||||
mstore(headStart, /** @src 0:124:126 \"41\" */ 0x29)
|
||||
@ -690,7 +689,7 @@ object \"C_54\" {
|
||||
mstore(4, 0x11)
|
||||
revert(0, 0x24)
|
||||
}
|
||||
function checked_add_int256_566(y) -> sum
|
||||
function checked_add_int256_556(y) -> sum
|
||||
{
|
||||
if and(1, sgt(y, sub(shl(255, 1), 42))) { panic_error_0x11() }
|
||||
sum := add(/** @src 0:124:126 \"41\" */ 0x29, /** @src 0:79:435 \"contract C...\" */ y)
|
||||
@ -712,13 +711,6 @@ object \"C_54\" {
|
||||
let ret := add(_3, 1)
|
||||
sstore(_2, ret)
|
||||
/// @src 0:410:418 \"this.f()\"
|
||||
if iszero(extcodesize(/** @src 0:410:414 \"this\" */ address()))
|
||||
/// @src 0:410:418 \"this.f()\"
|
||||
{
|
||||
/// @src 0:79:435 \"contract C...\"
|
||||
revert(_2, _2)
|
||||
}
|
||||
/// @src 0:410:418 \"this.f()\"
|
||||
let _4 := /** @src 0:79:435 \"contract C...\" */ mload(64)
|
||||
/// @src 0:410:418 \"this.f()\"
|
||||
mstore(_4, /** @src 0:79:435 \"contract C...\" */ shl(228, 0x026121ff))
|
||||
@ -1359,7 +1351,6 @@ object \"D_72\" {
|
||||
let expr_46_address := convert_t_contract$_C_$54_to_t_address(expr_45_address)
|
||||
let expr_46_functionSelector := 0x26121ff0
|
||||
/// @src 0:410:418 \"this.f()\"
|
||||
if iszero(extcodesize(expr_46_address)) { revert_error_0cc013b6b3b6beabea4e3a74a6d380f0df81852ca99887912475e1f66b2a2c20() }
|
||||
|
||||
// storage for arguments and returned data
|
||||
let _10 := allocate_unbounded()
|
||||
@ -1481,7 +1472,7 @@ object \"D_72\" {
|
||||
case 0x26121ff0 {
|
||||
if callvalue() { revert(_1, _1) }
|
||||
abi_decode(calldatasize())
|
||||
let ret := /** @src 0:286:305 \"constVar + immutVar\" */ checked_add_int256_566(/** @src 0:297:305 \"immutVar\" */ loadimmutable(\"8\"))
|
||||
let ret := /** @src 0:286:305 \"constVar + immutVar\" */ checked_add_int256_556(/** @src 0:297:305 \"immutVar\" */ loadimmutable(\"8\"))
|
||||
/// @src 1:91:166 \"contract D is C(3)...\"
|
||||
let memPos := mload(64)
|
||||
return(memPos, sub(abi_encode_int256(memPos, ret), memPos))
|
||||
@ -1505,7 +1496,7 @@ object \"D_72\" {
|
||||
if callvalue() { revert(_1, _1) }
|
||||
abi_decode(calldatasize())
|
||||
let memPos_3 := mload(64)
|
||||
return(memPos_3, sub(abi_encode_int256_565(memPos_3), memPos_3))
|
||||
return(memPos_3, sub(abi_encode_int256_555(memPos_3), memPos_3))
|
||||
}
|
||||
}
|
||||
revert(0, 0)
|
||||
@ -1514,7 +1505,7 @@ object \"D_72\" {
|
||||
{
|
||||
if slt(add(dataEnd, not(3)), 0) { revert(0, 0) }
|
||||
}
|
||||
function abi_encode_int256_565(headStart) -> tail
|
||||
function abi_encode_int256_555(headStart) -> tail
|
||||
{
|
||||
tail := add(headStart, 32)
|
||||
mstore(headStart, /** @src 0:124:126 \"41\" */ 0x29)
|
||||
@ -1531,7 +1522,7 @@ object \"D_72\" {
|
||||
mstore(4, 0x11)
|
||||
revert(0, 0x24)
|
||||
}
|
||||
function checked_add_int256_566(y) -> sum
|
||||
function checked_add_int256_556(y) -> sum
|
||||
{
|
||||
if and(1, sgt(y, sub(shl(255, 1), 42))) { panic_error_0x11() }
|
||||
sum := add(/** @src 0:124:126 \"41\" */ 0x29, /** @src 1:91:166 \"contract D is C(3)...\" */ y)
|
||||
@ -1553,13 +1544,6 @@ object \"D_72\" {
|
||||
let ret := add(_3, 1)
|
||||
sstore(_2, ret)
|
||||
/// @src 0:410:418 \"this.f()\"
|
||||
if iszero(extcodesize(/** @src 0:410:414 \"this\" */ address()))
|
||||
/// @src 0:410:418 \"this.f()\"
|
||||
{
|
||||
/// @src 1:91:166 \"contract D is C(3)...\"
|
||||
revert(_2, _2)
|
||||
}
|
||||
/// @src 0:410:418 \"this.f()\"
|
||||
let _4 := /** @src 1:91:166 \"contract D is C(3)...\" */ mload(64)
|
||||
/// @src 0:410:418 \"this.f()\"
|
||||
mstore(_4, /** @src 1:91:166 \"contract D is C(3)...\" */ shl(228, 0x026121ff))
|
||||
|
@ -61,9 +61,9 @@ contract C {
|
||||
// ----
|
||||
// test_bytes() ->
|
||||
// gas irOptimized: 377545
|
||||
// gas legacy: 423563
|
||||
// gas legacy: 418955
|
||||
// gas legacyOptimized: 331391
|
||||
// test_uint256() ->
|
||||
// gas irOptimized: 528726
|
||||
// gas legacy: 591392
|
||||
// gas legacy: 586784
|
||||
// gas legacyOptimized: 456137
|
||||
|
@ -27,5 +27,5 @@ contract C {
|
||||
// library: L
|
||||
// f() -> 8, 7, 1, 2, 7, 12
|
||||
// gas irOptimized: 167580
|
||||
// gas legacy: 169475
|
||||
// gas legacy: 169347
|
||||
// gas legacyOptimized: 167397
|
||||
|
@ -62,9 +62,9 @@ contract C {
|
||||
// ----
|
||||
// test_bytes() ->
|
||||
// gas irOptimized: 377545
|
||||
// gas legacy: 423563
|
||||
// gas legacy: 418955
|
||||
// gas legacyOptimized: 331391
|
||||
// test_uint256() ->
|
||||
// gas irOptimized: 528726
|
||||
// gas legacy: 591392
|
||||
// gas legacy: 586784
|
||||
// gas legacyOptimized: 456137
|
||||
|
@ -33,5 +33,5 @@ contract C is B {
|
||||
// ----
|
||||
// test() -> 77
|
||||
// gas irOptimized: 120044
|
||||
// gas legacy: 155221
|
||||
// gas legacy: 155093
|
||||
// gas legacyOptimized: 111678
|
||||
|
@ -41,4 +41,4 @@ contract C is B {
|
||||
// ----
|
||||
// test() -> 5, 10
|
||||
// gas irOptimized: 87578
|
||||
// gas legacy: 99137
|
||||
// gas legacy: 98881
|
||||
|
@ -22,5 +22,5 @@ contract C {
|
||||
// f(uint256[][1]): 32, 32, 1, 42 -> true
|
||||
// f(uint256[][1]): 32, 32, 8, 421, 422, 423, 424, 425, 426, 427, 428 -> true
|
||||
// gas irOptimized: 172204
|
||||
// gas legacy: 141900
|
||||
// gas legacy: 141644
|
||||
// gas legacyOptimized: 121788
|
||||
|
@ -18,4 +18,4 @@ contract D {
|
||||
// ----
|
||||
// f() -> FAILURE, hex"4e487b71", 0x11
|
||||
// g(), 100 wei -> 1
|
||||
// gas legacy: 101918
|
||||
// gas legacy: 101790
|
||||
|
@ -22,5 +22,5 @@ contract B {
|
||||
// ----
|
||||
// f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004
|
||||
// gas irOptimized: 130328
|
||||
// gas legacy: 235199
|
||||
// gas legacy: 234943
|
||||
// gas legacyOptimized: 133119
|
||||
|
@ -46,5 +46,5 @@ contract C {
|
||||
// ----
|
||||
// test() -> 5, 6, 7
|
||||
// gas irOptimized: 302321
|
||||
// gas legacy: 462080
|
||||
// gas legacy: 452172
|
||||
// gas legacyOptimized: 294938
|
||||
|
@ -27,5 +27,5 @@ contract Main {
|
||||
// ----
|
||||
// f(uint256): 0x34 -> 0x46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1
|
||||
// gas irOptimized: 113776
|
||||
// gas legacy: 126852
|
||||
// gas legacy: 126596
|
||||
// gas legacyOptimized: 114079
|
||||
|
@ -27,5 +27,5 @@ contract Creator {
|
||||
// ----
|
||||
// f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8
|
||||
// gas irOptimized: 456873
|
||||
// gas legacy: 590939
|
||||
// gas legacy: 590683
|
||||
// gas legacyOptimized: 448582
|
||||
|
@ -27,5 +27,5 @@ contract Creator {
|
||||
// ----
|
||||
// f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h"
|
||||
// gas irOptimized: 308702
|
||||
// gas legacy: 429173
|
||||
// gas legacy: 428917
|
||||
// gas legacyOptimized: 298384
|
||||
|
@ -19,4 +19,4 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 16
|
||||
// gas legacy: 103744
|
||||
// gas legacy: 103488
|
||||
|
@ -15,4 +15,4 @@ contract D {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 2
|
||||
// gas legacy: 101754
|
||||
// gas legacy: 101626
|
||||
|
@ -13,4 +13,4 @@ contract D {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 2
|
||||
// gas legacy: 101727
|
||||
// gas legacy: 101599
|
||||
|
@ -19,7 +19,7 @@ contract C {
|
||||
// ----
|
||||
// constructor(), 20 wei
|
||||
// gas irOptimized: 220113
|
||||
// gas legacy: 288299
|
||||
// gas legacy: 294569
|
||||
// gas legacyOptimized: 177933
|
||||
// f(uint256): 20 -> 1370859564726510389319704988634906228201275401179
|
||||
// x() -> 1
|
||||
@ -27,7 +27,7 @@ contract C {
|
||||
// x() -> 1
|
||||
// stack(uint256): 1023 -> FAILURE
|
||||
// gas irOptimized: 345821
|
||||
// gas legacy: 535367
|
||||
// gas legacy: 483942
|
||||
// gas legacyOptimized: 354656
|
||||
// x() -> 1
|
||||
// stack(uint256): 10 -> 693016686122178122849713379390321835634789309880
|
||||
|
@ -29,5 +29,5 @@ contract C {
|
||||
// ----
|
||||
// t() -> 9
|
||||
// gas irOptimized: 99186
|
||||
// gas legacy: 159083
|
||||
// gas legacy: 158955
|
||||
// gas legacyOptimized: 108916
|
||||
|
@ -30,7 +30,7 @@ contract C {
|
||||
// ----
|
||||
// f() -> 3, 7, 5
|
||||
// gas irOptimized: 127592
|
||||
// gas legacy: 151590
|
||||
// gas legacy: 151334
|
||||
// gas legacyOptimized: 125422
|
||||
// x() -> 7
|
||||
// y() -> 5
|
||||
|
@ -24,7 +24,7 @@ contract D {
|
||||
// ----
|
||||
// f() -> 1
|
||||
// gas irOptimized: 77164
|
||||
// gas legacy: 115012
|
||||
// gas legacy: 114884
|
||||
// g() -> 5
|
||||
// gas irOptimized: 77231
|
||||
// gas legacy: 115558
|
||||
// gas legacy: 115430
|
||||
|
@ -26,4 +26,4 @@ contract B {
|
||||
// ----
|
||||
// g() -> 42
|
||||
// gas irOptimized: 80945
|
||||
// gas legacy: 125609
|
||||
// gas legacy: 125481
|
||||
|
@ -26,5 +26,5 @@ contract B {
|
||||
// ----
|
||||
// g() -> 42
|
||||
// gas irOptimized: 111913
|
||||
// gas legacy: 185181
|
||||
// gas legacy: 185053
|
||||
// gas legacyOptimized: 114726
|
||||
|
@ -22,6 +22,6 @@ contract A {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// g(int256): -1 -> -1
|
||||
// gas legacy: 103622
|
||||
// gas legacy: 103494
|
||||
// g(int256): 10 -> 10
|
||||
// gas legacy: 103250
|
||||
// gas legacy: 103122
|
||||
|
@ -40,7 +40,7 @@ contract C {
|
||||
// gas irOptimized: 85640
|
||||
// convertSubA() -> 1, 2
|
||||
// gas irOptimized: 86395
|
||||
// gas legacy: 99303
|
||||
// gas legacy: 99047
|
||||
// convertSubB() -> 1, 3
|
||||
// gas irOptimized: 86338
|
||||
// gas legacy: 99237
|
||||
// gas legacy: 98981
|
||||
|
@ -23,5 +23,5 @@ contract A {
|
||||
// ----
|
||||
// f(), 10 ether -> 3007, 3008, 3009
|
||||
// gas irOptimized: 273275
|
||||
// gas legacy: 422885
|
||||
// gas legacy: 422501
|
||||
// gas legacyOptimized: 287856
|
||||
|
@ -27,5 +27,5 @@ contract D {
|
||||
// stateDecimal() -> right(42)
|
||||
// stateBytes() -> left(0x4200ef)
|
||||
// internalStateDecimal() -> 0x20
|
||||
// gas legacy: 101807
|
||||
// gas legacy: 101679
|
||||
// update(bool,uint256,bytes32): false, -23, left(0x2300ef) -> false, -23, left(0x2300ef)
|
||||
|
@ -42,4 +42,4 @@ contract C {
|
||||
// testRuntime() -> true
|
||||
// gas legacy: 101579
|
||||
// testCreation() -> true
|
||||
// gas legacy: 102137
|
||||
// gas legacy: 102009
|
||||
|
@ -26,4 +26,4 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test() -> 7
|
||||
// gas legacy: 102392
|
||||
// gas legacy: 102264
|
||||
|
@ -27,5 +27,5 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test() -> 9, 7
|
||||
// gas legacy: 130016
|
||||
// gas legacy: 129760
|
||||
// t2() -> 9
|
||||
|
@ -23,5 +23,5 @@ contract C {
|
||||
// ----
|
||||
// g() -> 2, 6
|
||||
// gas irOptimized: 178953
|
||||
// gas legacy: 180890
|
||||
// gas legacy: 180762
|
||||
// gas legacyOptimized: 179609
|
||||
|
@ -36,12 +36,12 @@ contract D {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 0x1 # This should work, next should throw #
|
||||
// gas legacy: 103844
|
||||
// gas legacy: 103716
|
||||
// fview() -> FAILURE
|
||||
// gas irOptimized: 98438627
|
||||
// gas legacy: 98438803
|
||||
// gas legacy: 98438801
|
||||
// gas legacyOptimized: 98438596
|
||||
// fpure() -> FAILURE
|
||||
// gas irOptimized: 98438627
|
||||
// gas legacy: 98438803
|
||||
// gas legacy: 98438801
|
||||
// gas legacyOptimized: 98438597
|
||||
|
Loading…
Reference in New Issue
Block a user