-
Notifications
You must be signed in to change notification settings - Fork 21
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
Apply val_cnt
and pop_cnt
to pop_label()
#710
Conversation
91cae13
to
6cf67b3
Compare
val_cnt
and pop_cnt
in side tableval_cnt
and pop_cnt
to pop_label()
side_table: &'m [SideTableEntry], | ||
/// Total length of the value stack in the thread prior to this frame. | ||
prev_stack: usize, | ||
labels_cnt: usize, |
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.
@ia0 Do you expect this to be removed eventually? Only from the performance perspective, I'm not sure how much gain there would be by removing it. WDYT?
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.
Yes, I expect this to be eventually removed (as well as push_label()
). This is not only cleaner, but also useful for when we'll write a compiler to our own bytecode (or an ISA) because it means we don't need to compile instructions like Block
or Loop
that don't do anything except indicate a scope.
But this can be done in a separate PR.
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.
Thanks! That's a really nice cleanup. I'll push a small review commit and merge.
side_table: &'m [SideTableEntry], | ||
/// Total length of the value stack in the thread prior to this frame. | ||
prev_stack: usize, | ||
labels_cnt: usize, |
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.
Yes, I expect this to be eventually removed (as well as push_label()
). This is not only cleaner, but also useful for when we'll write a compiler to our own bytecode (or an ISA) because it means we don't need to compile instructions like Block
or Loop
that don't do anything except indicate a scope.
But this can be done in a separate PR.
Before change:
After change:
|
@ia0 Could you also get the current code size? Thanks! |
You just need to run |
val_cnt
andpop_cnt
.Label
by introducingFrame::labels_cnt
.There is not much performance improvement on Linux due to this PR, which replaces
in
pop_label()
bypop_cnt + val_cnt
.#46