-
Notifications
You must be signed in to change notification settings - Fork 38
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
Remove instruction metrics (except max align) #414
Conversation
Codecov Report
@@ Coverage Diff @@
## master #414 +/- ##
==========================================
+ Coverage 99.33% 99.36% +0.02%
==========================================
Files 50 49 -1
Lines 14175 14169 -6
==========================================
- Hits 14081 14079 -2
+ Misses 94 90 -4 |
36347e2
to
82ef0cb
Compare
7d2c6c3
to
3adfb02
Compare
0d30b02
to
7beb186
Compare
82ef0cb
to
13f124c
Compare
@@ -248,7 +248,6 @@ parser_result<Code> parse_expr(const uint8_t* pos, const uint8_t* end, FuncIdx f | |||
std::tie(opcode, pos) = parse_byte(pos, end); | |||
|
|||
auto& frame = control_stack.top(); | |||
const auto& metrics = metrics_table[opcode]; | |||
const auto& type = type_table[opcode]; |
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.
I'd rather have max_align
here.
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.
Why? It's used only in subset of instructions, which are handled all in one switch case, so why put it into wider scope?
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.
My reasoning is that none of the cases in the switch use the opcode
variable and one must go up to the top to find it. Perhaps benchmarking can show which is faster :)
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.
Tried to benchmark, it doesn't make any difference.
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.
If there's no speed difference I'd prefer it at the top.
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.
Made max_align
variable.
13f124c
to
87bea74
Compare
9b97f70
to
a019c4a
Compare
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.
This is ok, but you can much smaller table using switch
only for relevant instructions.
a019c4a
to
1b71bc7
Compare
1b71bc7
to
cd1903d
Compare
Depends on #403