Conversation
Add codegen timing field to Remarks, CompileTimings public struct, backend()/backend_mut() accessors, and take_timings() API. Derive Debug on EvmCompiler via derive_more.
Add call_with_interpreter_with() to configure EvmContext before execution, enabling inspector callbacks like on_log without full handler override.
Charge state gas for new slot creation in SSTORE and new account creation in SELFDESTRUCT when Amsterdam EIP-8037 is enabled. Also fire on_log callback in LOG builtin and fix prevrandao unwrap.
Use owned State<EmptyDB> instead of transmuting a mutable reference to 'static. The Handler trait no longer requires the 'static bound.
Cover Petersburg and Istanbul specs where static gas costs differ from Berlin+ (700 vs 100).
Override inspect_frame_run to dispatch JIT-compiled functions with on_log callback forwarding to the inspector, selfdestruct handling, and frame_end notification. Also impl InspectCommitEvm blanket.
The ecx pointer is passed to extern builtin calls which modify the same allocation. With noalias, LLVM may hoist or cache loads across those calls, leading to incorrect gas accounting. Also set debug_assertions(false) in the statetest compiler so CI exercises the production attribute path.
Merging this PR will degrade performance by 28.86%
Performance Changes
Comparing Footnotes
|
# Conflicts: # crates/revmc-codegen/src/compiler/translate/peephole.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This inlines memory operations in the compiler so MLOAD/MSTORE paths can stay in generated code instead of going through builtins. The change increases generated code size, but removes runtime builtin calls and exposes more memory operations to LLVM.
Benchmarks
Headline numbers vs
origin/mainacross all benchmarks discovered by./scripts/bench.py(21 built-ins plus 9tmp/mainnetcontracts): jit size +20.1%, total compile time +41.5%, and codegen +44.7%. The extra compile-time/code-size cost is expected from inlining memory handling into generated code; the tradeoff is intended to improve runtime hot-path locality.Codegen statistics
Full details
371
+4.2% 🔴
127
+12.4% 🔴
303
-1.0% 🟢
414 B
-6.8% 🟢
2
=
2
-33.3% 🟢
5
=
5
-16.7% 🟢
363
+4.3% 🔴
129
+12.2% 🔴
342
-1.7% 🟢
546 B
-9.2% 🟢
2
=
2
-33.3% 🟢
5
-37.5% 🟢
6
-33.3% 🟢
1071
+5.2% 🔴
388
+13.1% 🔴
594
+9.8% 🔴
1.0 KiB
+17.5% 🔴
9
+12.5% 🔴
9
+28.6% 🔴
0
-
0
-
61587
+13.0% 🔴
27765
+34.7% 🔴
50707
+22.8% 🔴
139.0 KiB
+21.3% 🔴
1540
+11.7% 🔴
2172
-3.3% 🟢
316
+229.2% 🔴
2592
+390.9% 🔴
14076
+10.3% 🔴
5065
+35.2% 🔴
7730
+21.4% 🔴
24.5 KiB
+20.2% 🔴
268
+4.7% 🔴
363
+6.8% 🔴
71
+115.2% 🔴
215
+99.1% 🔴
1090
+12.6% 🔴
430
+39.2% 🔴
743
+33.4% 🔴
2.0 KiB
+49.8% 🔴
19
+18.8% 🔴
22
-4.3% 🟢
1
-
12
-
15213
+9.5% 🔴
6235
+27.5% 🔴
11545
+17.5% 🔴
30.1 KiB
+17.3% 🔴
309
+0.3% 🔴
456
+3.4% 🔴
29
+107.1% 🔴
195
+137.8% 🔴
371
=
183
=
339
=
633 B
=
1
=
15
=
0
-
0
-
7602
+6.1% 🔴
3071
+18.3% 🔴
5263
+11.2% 🔴
12.5 KiB
+6.8% 🔴
105
=
196
=
30
+25.0% 🔴
32
+39.1% 🔴
85132
+9.7% 🔴
32151
+33.5% 🔴
52873
+20.7% 🔴
164.9 KiB
+14.1% 🔴
1804
+1.7% 🔴
2591
-0.5% 🟢
284
+64.2% 🔴
1180
+57.8% 🔴
48186
+10.0% 🔴
18864
+33.5% 🔴
30964
+25.0% 🔴
97.2 KiB
+22.4% 🔴
929
+4.6% 🔴
1404
+2.4% 🔴
172
+115.0% 🔴
741
+70.0% 🔴
89121
+8.9% 🔴
34270
+31.0% 🔴
54550
+18.2% 🔴
180.6 KiB
+9.6% 🔴
2085
+3.8% 🔴
2821
-3.0% 🟢
406
+49.3% 🔴
1195
+122.5% 🔴
147414
+12.5% 🔴
67531
+33.5% 🔴
119235
+26.3% 🔴
360.5 KiB
+22.9% 🔴
4587
+8.4% 🔴
5104
-3.1% 🟢
1094
+150.3% 🔴
5316
+114.1% 🔴
29759
+9.0% 🔴
12155
+29.6% 🔴
19964
+16.1% 🔴
56.5 KiB
+19.8% 🔴
576
+2.9% 🔴
868
+3.2% 🔴
104
+82.5% 🔴
398
+17.1% 🔴
2441
+15.2% 🔴
781
+45.4% 🔴
1113
+9.9% 🔴
3.4 KiB
+30.9% 🔴
29
=
34
-35.8% 🟢
2
-
2
-
1967
+8.9% 🔴
632
+29.0% 🔴
1100
+20.7% 🔴
3.2 KiB
+26.7% 🔴
34
+3.0% 🔴
54
+5.9% 🔴
6
-
6
-
616
+3.2% 🔴
243
+8.5% 🔴
422
+3.2% 🔴
777 B
+8.5% 🔴
9
+12.5% 🔴
10
+11.1% 🔴
1
=
1
=
561
+3.5% 🔴
215
+9.7% 🔴
412
+3.5% 🔴
807 B
+9.2% 🔴
7
+16.7% 🔴
6
+20.0% 🔴
0
-
0
-
24807
+6.4% 🔴
10136
+17.2% 🔴
17594
+12.6% 🔴
32.0 KiB
+13.4% 🔴
529
+1.3% 🔴
832
+2.5% 🔴
94
+276.0% 🔴
208
+96.2% 🔴
66045
+4.9% 🔴
24475
+14.7% 🔴
46731
+15.8% 🔴
119.9 KiB
+11.4% 🔴
1369
+1.2% 🔴
1654
-2.2% 🟢
250
+273.1% 🔴
1998
+324.2% 🔴
231479
+10.5% 🔴
94564
+31.6% 🔴
158444
+20.2% 🔴
260.3 KiB
+17.7% 🔴
5743
+8.4% 🔴
6773
-0.9% 🟢
1571
+162.3% 🔴
4877
+80.0% 🔴
150000
+12.2% 🔴
54319
+39.7% 🔴
91006
+30.3% 🔴
302.8 KiB
+31.9% 🔴
3141
+5.2% 🔴
4849
+8.0% 🔴
1301
+261.4% 🔴
3151
+20.1% 🔴
154764
+12.5% 🔴
54355
+49.7% 🔴
97788
+29.5% 🔴
358.8 KiB
+18.7% 🔴
3836
+6.7% 🔴
5088
-4.8% 🟢
887
+43.3% 🔴
2957
+34.2% 🔴
155096
+12.3% 🔴
54435
+48.8% 🔴
98162
+30.0% 🔴
359.3 KiB
+19.1% 🔴
3847
+6.4% 🔴
5077
-4.9% 🟢
897
+44.2% 🔴
2980
+42.0% 🔴
163553
+11.4% 🔴
60189
+43.4% 🔴
105917
+27.0% 🔴
375.7 KiB
+20.0% 🔴
4138
+5.8% 🔴
4911
-3.9% 🟢
1307
+73.1% 🔴
2406
+3.1% 🔴
131966
+8.8% 🔴
49741
+29.9% 🔴
73706
+18.6% 🔴
229.0 KiB
+11.0% 🔴
2626
+3.5% 🔴
3462
+1.2% 🔴
835
+80.3% 🔴
2626
+91.5% 🔴
134565
+11.4% 🔴
51259
+37.7% 🔴
84010
+27.2% 🔴
265.4 KiB
+25.2% 🔴
2729
+3.8% 🔴
3475
-1.5% 🟢
586
+131.6% 🔴
2095
+36.7% 🔴
148543
+13.9% 🔴
56649
+50.6% 🔴
91288
+33.3% 🔴
304.5 KiB
+28.3% 🔴
2990
+3.7% 🔴
4361
-2.4% 🟢
1138
+300.7% 🔴
1400
-12.9% 🟢
133075
+11.5% 🔴
50744
+37.9% 🔴
82946
+26.9% 🔴
263.3 KiB
+25.4% 🔴
2697
+3.9% 🔴
3438
-1.5% 🟢
609
+143.6% 🔴
2252
+48.2% 🔴
104854
+8.3% 🔴
37443
+29.7% 🔴
53327
+18.1% 🔴
165.4 KiB
+13.6% 🔴
1966
+4.9% 🔴
2796
+2.2% 🔴
444
+123.1% 🔴
1348
+52.3% 🔴
2105688
+10.9% 🔴
808544
+36.3% 🔴
1359118
+24.4% 🔴
4.0 MiB
+20.1% 🔴
47926
+5.5% 🔴
62845
-1.3% 🟢
12445
+118.5% 🔴
40194
+62.3% 🔴
Compile times
Full compile times
10.1ms
+3.4% 🔴
191.9µs
+0.4% 🔴
662.6µs
+37.7% 🔴
6.01ms
+5.5% 🔴
3.21ms
-4.8% 🟢
11.0ms
-0.3% 🟢
185.8µs
-35.7% 🟢
507.2µs
-13.6% 🟢
6.32ms
-2.5% 🟢
3.95ms
+8.4% 🔴
14.9ms
+9.2% 🔴
374.2µs
+7.4% 🔴
639.4µs
+9.1% 🔴
8.64ms
+5.2% 🔴
5.27ms
+16.6% 🔴
2.078s
+29.7% 🔴
8.28ms
+0.1% 🔴
11.9ms
+8.1% 🔴
1.190s
+31.8% 🔴
868.1ms
+27.7% 🔴
223.8ms
+36.1% 🔴
2.31ms
+6.5% 🔴
3.32ms
+21.6% 🔴
131.6ms
+35.5% 🔴
86.6ms
+38.7% 🔴
20.0ms
+25.1% 🔴
301.7µs
-13.5% 🟢
650.9µs
-0.6% 🟢
11.9ms
+23.9% 🔴
7.11ms
+33.1% 🔴
413.1ms
+26.6% 🔴
2.80ms
-14.7% 🟢
3.36ms
-10.5% 🟢
242.1ms
+27.2% 🔴
164.8ms
+27.7% 🔴
9.84ms
-11.3% 🟢
169.9µs
-32.7% 🟢
484.8µs
-23.5% 🟢
5.94ms
-8.3% 🟢
3.24ms
-12.9% 🟢
128.9ms
+18.4% 🔴
1.43ms
-0.8% 🟢
1.95ms
-5.6% 🟢
77.3ms
+17.6% 🔴
48.2ms
+21.7% 🔴
1.865s
+41.3% 🔴
15.9ms
+3.9% 🔴
16.8ms
+14.3% 🔴
1.112s
+40.3% 🔴
719.9ms
+44.7% 🔴
879.2ms
+20.1% 🔴
7.29ms
+0.6% 🔴
9.42ms
+13.7% 🔴
519.2ms
+10.3% 🔴
343.3ms
+39.4% 🔴
1.876s
+35.4% 🔴
15.5ms
+4.2% 🔴
18.6ms
+16.7% 🔴
1.122s
+36.9% 🔴
719.9ms
+34.4% 🔴
4.793s
+44.0% 🔴
20.7ms
-26.2% 🟢
29.5ms
+6.1% 🔴
3.102s
+45.2% 🔴
1.641s
+44.5% 🔴
532.7ms
+7.2% 🔴
4.75ms
+0.4% 🔴
6.02ms
+6.2% 🔴
316.7ms
-3.7% 🟢
205.3ms
+30.2% 🔴
29.7ms
+27.9% 🔴
511.7µs
-3.2% 🟢
977.6µs
+11.2% 🔴
17.7ms
+26.2% 🔴
10.5ms
+35.0% 🔴
27.3ms
+26.2% 🔴
475.6µs
+6.2% 🔴
758.8µs
-5.4% 🟢
16.0ms
+27.5% 🔴
10.1ms
+28.3% 🔴
12.7ms
+5.9% 🔴
238.1µs
-3.4% 🟢
590.7µs
-0.5% 🟢
7.54ms
+6.1% 🔴
4.32ms
+7.1% 🔴
11.1ms
-3.4% 🟢
212.2µs
-24.0% 🟢
525.2µs
-17.4% 🟢
6.61ms
-1.7% 🟢
3.79ms
-2.5% 🟢
463.8ms
+16.7% 🔴
4.05ms
-6.9% 🟢
4.89ms
-8.7% 🟢
287.1ms
+15.7% 🔴
167.8ms
+20.2% 🔴
1.809s
+17.5% 🔴
255.9ms
-2.6% 🟢
16.0ms
+12.3% 🔴
905.3ms
+20.9% 🔴
632.1ms
+22.9% 🔴
6.470s
+21.3% 🔴
38.7ms
+0.3% 🔴
47.3ms
+10.6% 🔴
3.976s
+23.2% 🔴
2.408s
+18.7% 🔴
3.522s
+35.9% 🔴
25.0ms
-1.7% 🟢
29.0ms
-4.9% 🟢
2.187s
+36.0% 🔴
1.281s
+38.1% 🔴
3.354s
+60.9% 🔴
23.5ms
+3.3% 🔴
29.1ms
+13.7% 🔴
1.970s
+60.6% 🔴
1.332s
+64.8% 🔴
3.318s
+58.9% 🔴
22.8ms
+1.5% 🔴
29.2ms
+10.8% 🔴
1.960s
+57.6% 🔴
1.307s
+64.4% 🔴
3.956s
+52.6% 🔴
25.1ms
+2.6% 🔴
32.5ms
+18.1% 🔴
2.386s
+55.0% 🔴
1.513s
+51.1% 🔴
3.271s
+33.3% 🔴
20.3ms
+0.8% 🔴
26.7ms
+12.1% 🔴
2.088s
+34.7% 🔴
1.136s
+32.3% 🔴
3.160s
+43.9% 🔴
20.2ms
=
25.6ms
+7.8% 🔴
1.977s
+46.7% 🔴
1.136s
+41.3% 🔴
3.616s
+73.8% 🔴
21.5ms
-3.3% 🟢
28.6ms
+6.8% 🔴
2.149s
+67.1% 🔴
1.417s
+90.3% 🔴
3.136s
+59.3% 🔴
19.1ms
-4.1% 🟢
26.3ms
+22.5% 🔴
1.918s
+56.4% 🔴
1.173s
+67.1% 🔴
2.505s
+69.6% 🔴
16.3ms
-2.4% 🟢
20.6ms
+14.1% 🔴
1.466s
+59.0% 🔴
1.002s
+92.5% 🔴
51.517s
+41.5% 🔴
574.0ms
-2.4% 🟢
422.3ms
+10.0% 🔴
31.169s
+41.3% 🔴
19.353s
+44.7% 🔴