Note function entry points.

This commit is contained in:
chriseth
2021-05-04 17:15:13 +02:00
parent faca036837
commit f9c94d7c42
33 changed files with 252 additions and 26 deletions
@@ -0,0 +1 @@
--optimize --combined-json function-debug,function-debug-runtime --pretty-json
@@ -0,0 +1 @@
@@ -0,0 +1,11 @@
pragma solidity >=0.0;
// SPDX-License-Identifier: GPL-3.0
contract C {
function f(uint[] calldata x) pure external returns (uint) { return x[0]; }
// This will be optimized out
function g() pure internal {}
mapping(uint => uint) public t;
constructor(uint x) {
t[0] = x;
}
}
@@ -0,0 +1,57 @@
{
"contracts":
{
"function_debug_info/input.sol:C":
{
"function-debug":
{
"@_34":
{
"id": 34,
"parameterSlots": 1,
"returnSlots": 0
},
"abi_decode_tuple_t_uint256_fromMemory":
{
"entryPoint": 94,
"parameterSlots": 2,
"returnSlots": 1
}
},
"function-debug-runtime":
{
"@f_14":
{
"entryPoint": 128,
"id": 14,
"parameterSlots": 2,
"returnSlots": 1
},
"@t_22":
{
"id": 22,
"parameterSlots": 0,
"returnSlots": 0
},
"abi_decode_tuple_t_array$_t_uint256_$dyn_calldata_ptr":
{
"entryPoint": 178,
"parameterSlots": 2,
"returnSlots": 2
},
"abi_decode_tuple_t_uint256":
{
"entryPoint": 295,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed":
{
"parameterSlots": 2,
"returnSlots": 1
}
}
}
},
"version": "<VERSION REMOVED>"
}
@@ -0,0 +1 @@
--experimental-via-ir --optimize --combined-json function-debug,function-debug-runtime --pretty-json
@@ -0,0 +1 @@
@@ -0,0 +1,7 @@
pragma solidity >=0.0;
// SPDX-License-Identifier: GPL-3.0
contract C {
function f(uint[] calldata x) pure external returns (uint) { return x[0]; }
// This will be optimized out
function g() pure internal {}
}
@@ -0,0 +1,11 @@
{
"contracts":
{
"function_debug_info_via_yul/input.sol:C":
{
"function-debug": {},
"function-debug-runtime": {}
}
},
"version": "<VERSION REMOVED>"
}
@@ -0,0 +1,18 @@
{
"language": "Solidity",
"sources": {
"a.sol": {
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0; pragma abicoder v2; contract A { function f(uint[] memory x) public pure returns (uint256) { return x[0] + x[1];} }"
}
},
"settings": {
"outputSelection": {
"*": {
"A": [
"evm.deployedBytecode.functionDebugData",
"evm.bytecode.functionDebugData"
]
}
}
}
}
@@ -0,0 +1 @@
{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"functionDebugData":{}},"deployedBytecode":{"functionDebugData":{"@f_19":{"entryPoint":96,"id":19,"parameterSlots":1,"returnSlots":1},"abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":247,"id":null,"parameterSlots":3,"returnSlots":1},"abi_decode_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":359,"id":null,"parameterSlots":2,"returnSlots":1},"abi_decode_t_uint256":{"entryPoint":405,"id":null,"parameterSlots":2,"returnSlots":1},"abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":426,"id":null,"parameterSlots":2,"returnSlots":1},"abi_encode_t_uint256_to_t_uint256_fromStack":{"entryPoint":499,"id":null,"parameterSlots":2,"returnSlots":0},"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed":{"entryPoint":514,"id":null,"parameterSlots":2,"returnSlots":1},"allocate_memory":{"entryPoint":541,"id":null,"parameterSlots":1,"returnSlots":1},"allocate_unbounded":{"entryPoint":568,"id":null,"parameterSlots":0,"returnSlots":1},"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":578,"id":null,"parameterSlots":1,"returnSlots":1},"checked_add_t_uint256":{"entryPoint":622,"id":null,"parameterSlots":2,"returnSlots":1},"cleanup_t_uint256":{"entryPoint":708,"id":null,"parameterSlots":1,"returnSlots":1},"finalize_allocation":{"entryPoint":718,"id":null,"parameterSlots":2,"returnSlots":0},"panic_error_0x11":{"entryPoint":767,"id":null,"parameterSlots":0,"returnSlots":0},"panic_error_0x41":{"entryPoint":814,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d":{"entryPoint":861,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef":{"entryPoint":866,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db":{"entryPoint":871,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b":{"entryPoint":876,"id":null,"parameterSlots":0,"returnSlots":0},"round_up_to_mul_of_32":{"entryPoint":881,"id":null,"parameterSlots":1,"returnSlots":1},"validator_revert_t_uint256":{"entryPoint":898,"id":null,"parameterSlots":1,"returnSlots":0}}}}}}},"sources":{"a.sol":{"id":0}}}
+1 -1
View File
@@ -14,7 +14,7 @@
sstore
/* \"A\":0:42 */
pop
","bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}},"ir":"object \"object\" {
","bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}},"ir":"object \"object\" {
code {
let x := mload(0)
sstore(add(x, 0), 0)
@@ -13,7 +13,7 @@
pop
stop
data_4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 616263
","bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}},"ir":"object \"NamedObject\" {
","bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}},"ir":"object \"NamedObject\" {
code {
let x := dataoffset(\"DataName\")
sstore(add(x, 0), 0)
@@ -22,7 +22,7 @@ sub_0: assembly {
/* \"A\":137:149 */
revert
}
","bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"},"deployedBytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}},"ir":"object \"NamedObject\" {
","bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"},"deployedBytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}},"ir":"object \"NamedObject\" {
code {
let x := dataoffset(\"DataName\")
sstore(add(x, 0), 0)
@@ -13,7 +13,7 @@
/* \"A\":20:40 */
sstore
pop
","bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}},"ir":"object \"object\" {
","bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}},"ir":"object \"object\" {
code {
let x := mload(0)
sstore(add(x, 0), 0)
@@ -5,7 +5,7 @@
mload
/* \"A\":20:40 */
sstore
","bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}},"ir":"object \"object\" {
","bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}},"ir":"object \"object\" {
code {
let x := mload(0)
sstore(add(x, 0), 0)