Add heuristic to skip jumpdest analysis
We can guess that the jumpdest analysis is not needed by inspecting the first opcode. This heuristic has some false negatives but is very cheap and covers EOF. The proof it is correct is done at compile-time.
Bigger idea behind this is to only use the heuristic not to waste time on jumpdest analysis and delay EOF header parsing until execution. This makes the code analysis EVM revision agnostic. Maybe someone can push this idea further.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.30%. Comparing base (
080a341) to head (aee1c86). Report is 1 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #990 +/- ##
=======================================
Coverage 94.29% 94.30%
=======================================
Files 144 144
Lines 16155 16159 +4
=======================================
+ Hits 15234 15238 +4
Misses 921 921
| Flag | Coverage Δ | |
|---|---|---|
| eof_execution_spec_tests | 16.72% <100.00%> (+0.02%) |
:arrow_up: |
| ethereum_tests | 26.63% <100.00%> (+0.01%) |
:arrow_up: |
| ethereum_tests_silkpre | 18.69% <100.00%> (+0.01%) |
:arrow_up: |
| execution_spec_tests | 17.78% <100.00%> (+0.02%) |
:arrow_up: |
| unittests | 89.74% <100.00%> (+<0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| lib/evmone/baseline_analysis.cpp | 100.00% <100.00%> (ø) |
|
| lib/evmone/baseline_instruction_table.cpp | 100.00% <100.00%> (ø) |
|
| test/unittests/instructions_test.cpp | 88.88% <ø> (ø) |