Commit Graph

329 Commits

Author SHA1 Message Date
Daniel Kirchner
c23b18926f Adjusted stack compression for testing. 2021-08-18 13:28:28 +02:00
Daniel Kirchner
4c9fcda641 Add optimizer setting for fuzzing. 2021-08-18 10:02:32 +02:00
Daniel Kirchner
8bd358074e Compatibility with StackCompressor and StackLimitEvader. 2021-08-17 19:00:28 +02:00
Daniel Kirchner
de7f26c15d Enable the new code generator for "system" inline assembly routines. 2021-08-17 19:00:28 +02:00
Daniel Kirchner
68a0af709b Enable for IR code generation with stack optimization > homestead. 2021-08-17 19:00:28 +02:00
Daniel Kirchner
c0c214df2b Optimized EVM Code Transform. 2021-08-17 19:00:17 +02:00
Daniel Kirchner
1e3034a0eb Clarification with some comments and another assertion to help understanding the preconditions. 2021-08-17 18:59:57 +02:00
Daniel Kirchner
1612648268 Maintain only one best candidate during combineStack. 2021-08-17 13:24:11 +02:00
Daniel Kirchner
79d39d241c Simplify compressStack. 2021-08-17 13:24:11 +02:00
Daniel Kirchner
a58694ca4d Also push deep slots early if swapping is required later. 2021-08-17 13:24:11 +02:00
Daniel Kirchner
ae48500147 Refactor createIdealLayout slightly and add more comments. 2021-08-16 17:34:00 +02:00
Daniel Kirchner
3bfd437ba7 Fixup! coding style from review suggestion. 2021-08-16 17:34:00 +02:00
Daniel Kirchner
556bd9adfc Remove fixStackTooDeep and adjust combineStack comments. 2021-08-16 17:34:00 +02:00
Daniel Kirchner
3bb7414703 Review comments. 2021-08-16 17:34:00 +02:00
Daniel Kirchner
387c248601 Adjust pushDeepSlotIfRequired (and rename to dupDeepSlotIfRequired). 2021-08-16 17:34:00 +02:00
Daniel Kirchner
eca4fb6781 Adjust and extend comments for the stack shuffling operations. 2021-08-16 17:34:00 +02:00
Daniel Kirchner
535d30bbb3 Avoid dupping slots if doing so causes other needed slots to become unreachable. 2021-08-16 17:34:00 +02:00
Daniel Kirchner
74edc40a7e Reorder functions in implementation to match order in header. 2021-08-16 17:34:00 +02:00
Daniel Kirchner
6037c4f26c Add function to FunctionReturnLabelSlot and assert that functions are identical in comparison operators. 2021-08-16 17:34:00 +02:00
Daniel Kirchner
9f46fff467 Review suggestions and a lot more comments. 2021-08-16 17:34:00 +02:00
Daniel Kirchner
a756ec3e0e Attempt to split up the main algorithm a bit. 2021-08-16 17:33:59 +02:00
Daniel Kirchner
1fd4cf2254 Stack layout generator for new code generation. 2021-08-16 17:33:59 +02:00
chriseth
90c4623460 Some more base fees. 2021-08-12 16:37:21 +02:00
chriseth
a4c94a1b5b Fixed inline assembly external identifier access. 2021-08-11 18:18:29 +02:00
hrkrshnn
7f1a2be0fe Allow basefee as Yul identifier for EVMVersion < london
This was done to prevent basefee from being a breaking change. This change will be removed in 0.9.0.

TODO revert this commit in breaking.
2021-08-11 10:46:08 +02:00
chriseth
467cbf92bc Only provide code generator to CodeTransform. 2021-08-04 18:38:10 +02:00
Christian Parpart
6294aa871a Simplify AsmParser::parse(.) usage 2021-08-03 15:43:17 +02:00
chriseth
ffc5cfd9a5 Remove scanner from compiler stack. 2021-08-03 15:43:17 +02:00
Daniel Kirchner
f3707f2ab0 Control flow graph for Yul. 2021-07-15 15:24:12 +02:00
chriseth
f75b55071e Remove CharStream from SourceLocation. 2021-07-14 15:12:07 +02:00
chriseth
8d5e82b406 Fix source location of builtin function calls. 2021-07-06 16:54:29 +02:00
Daniel Kirchner
bc288aacf5 Have the stack optimization in the code transform only reuse slots that are reachable and fix argument slot reuse on functions without return variables. 2021-06-28 18:11:57 +02:00
chriseth
0df8a38e55 Support metadata via IR. 2021-06-21 18:20:31 +02:00
chriseth
fe35512feb Remove EVMAssembly. 2021-06-08 18:41:22 +02:00
TerranCivilian
c15501eea9 Remove unneeded include files 2021-06-07 12:53:18 -04:00
chriseth
f9c94d7c42 Note function entry points. 2021-05-04 17:15:13 +02:00
Djordje Mijovic
e404b6e7a6 Refactoring yul source locations. 2021-05-04 16:05:23 +02:00
Alex Beregszaszi
176ce4edf7 Split EthAssemblyAdapter from AsmCodeGen 2021-04-27 11:31:15 +01:00
chriseth
cb1af8b88a Make verbatim compatible with KnownState. 2021-04-26 19:56:44 +02:00
chriseth
e2d8005737 Add verbatim builtin. 2021-04-26 19:56:44 +02:00
Alexander Arlt
fc7fb3cb7d [ewasm] Polyfill: callvalue, gasprice & difficulty. 2021-04-23 15:54:10 +01:00
hrkrshnn
011f8d3ff7 Changed the type of gas calculation to bigint instead of size_t
Since the gas calculation can involve multiplication by ``--optimize-runs``, it is possible that
`size_t` is not enough to represent the total gas.
2021-04-22 18:19:47 +02:00
hrkrshnn
94f9410abe Added hashFunction to Dialect. For EVMDialect, it is keccak256
In a later PR, the functions `storageLoadFunction`, `storageStoreFunctions`, etc will be refactored
to return a YulString instead of a pointer to a BuiltinFunction.
2021-04-22 17:27:57 +02:00
hrkrshnn
dd6300a53e GasMeter can now account for gas of Keccak-256 2021-04-22 17:27:57 +02:00
hrkrshnn
1f5b874eaf Optimizer context has parameter expectedExecutionsPerDeployment 2021-04-22 17:27:57 +02:00
Daniel Kirchner
5bebbca273 Extract VariableReferenceCounter and StackTooDeep error from EVMCodeTransform. 2021-04-13 10:41:16 +02:00
chriseth
2856f56525
Merge pull request #10942 from ethereum/returnSlotAllocation
Delayed return slot allocation.
2021-04-08 16:42:07 +02:00
anurag4u80
b2ca7916aa Replaced boost::adaptors::transformed 2021-04-08 17:38:14 +05:30
Daniel Kirchner
35c2eeab68 Restrict to only popping, but not reusing argument slots, as well as only freeing up until the return slots are allocated. 2021-04-06 13:38:06 +02:00
Daniel Kirchner
4b0f8383a6 Reuse function argument slots and defer allocation of return variable slots in EVMCodeTransform. 2021-04-06 13:38:05 +02:00