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.
@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.
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.
ia0
left a comment
There was a problem hiding this comment.
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.
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_cntandpop_cnt.Labelby 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