Skip to content
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

Add classification of EVM instructions (op_kind) #173

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

chfast
Copy link
Member

@chfast chfast commented Sep 12, 2019

Requires #168.

@codecov-io
Copy link

codecov-io commented Sep 12, 2019

Codecov Report

Merging #173 into master will decrease coverage by 13.4%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           master     #173       +/-   ##
===========================================
- Coverage     100%   86.59%   -13.41%     
===========================================
  Files           5       22       +17     
  Lines         839     2260     +1421     
  Branches      109      220      +111     
===========================================
+ Hits          839     1957     +1118     
- Misses          0      276      +276     
- Partials        0       27       +27

@chfast chfast marked this pull request as ready for review September 16, 2019 20:12
@chfast
Copy link
Member Author

chfast commented Sep 16, 2019

This looks nice, but in the end makes the analysis loop much slower. I would need more hours of staring on the perf output to figure out why. By the way, I discovered an optimization in form of #178.

cc @gcolvin

/// Defines classification of EVM instructions.
enum class op_kind
{
regular, ///< Totally uninteresting instruction.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

};
static_assert(sizeof(op_table_entry) <= 2 * sizeof(void*));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is important, maybe op_kind's underlying type should be specified?

break;

case ANY_SMALL_PUSH:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can ANY_SMALL_PUSH and ANY_LARGE_PUSH definitions be deleted now?

case OP_REVERT:
case OP_SELFDESTRUCT:
is_terminator = true;
default:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say explicit cases here would more clearly show the intention

Suggested change
default:
op_kind::regular:
op_kind::terminator:

@axic
Copy link
Member

axic commented Feb 14, 2023

Is this PR still useful/relevant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants