-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analysis refactoring #153
Analysis refactoring #153
Conversation
Codecov Report
@@ Coverage Diff @@
## master #153 +/- ##
==========================================
+ Coverage 84.93% 85.15% +0.22%
==========================================
Files 21 21
Lines 2244 2237 -7
Branches 218 217 -1
==========================================
- Hits 1906 1905 -1
+ Misses 311 305 -6
Partials 27 27 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comments
lib/evmone/analysis.cpp
Outdated
case OP_SELFDESTRUCT: | ||
block = nullptr; | ||
break; | ||
if (create_new_block || (code_pos != code_end && *code_pos == OP_JUMPDEST)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could set create_new_block
to true
in if (opcode == OP_JUMPDEST)
above, then this would be simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, but if create_new_block
is already true
we don't have to perform other checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed that to is_terminator
. This is consistent with future changes in #158.
ffe2b85
to
c23e3bb
Compare
Added benchmark results. |
c23e3bb
to
d9ee8b0
Compare
Would it make sense merging all the test changes separately or they are different due to refactoring? |
Will do. |
#166. |
fdc3510
to
1853e06
Compare
How does it look now? |
lib/evmone/analysis.cpp
Outdated
// this is a terminating instruction or the next instruction is a JUMPDEST. | ||
block = &analysis.blocks.emplace_back(); | ||
block_stack_change = 0; | ||
analysis.instrs.emplace_back(fns[OPX_BEGINBLOCK]).arg.number = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here maybe split into two lines, too
1853e06
to
3cc7fa1
Compare
Requires #166.
Refactors analysis to have new block creation in single place. It also removes some unneeded variables and code.
TODO
Bechmarks: