ZJIT: Use SP for reloading locals - #16746
Merged
Merged
Conversation
nozomemein
force-pushed
the
zjit-usesp-reloadlocals
branch
from
April 15, 2026 00:37
1def70a to
7df7fb7
Compare
Contributor
Author
|
I found an issue related to this PR tht also reproduces on master. |
nozomemein
force-pushed
the
zjit-usesp-reloadlocals
branch
3 times, most recently
from
April 15, 2026 22:00
0bdeed7 to
ee867a4
Compare
nozomemein
force-pushed
the
zjit-usesp-reloadlocals
branch
from
April 15, 2026 22:26
ee867a4 to
d689004
Compare
nozomemein
marked this pull request as ready for review
April 15, 2026 23:05
k0kubun
reviewed
Apr 15, 2026
Comment on lines
+8093
to
+8095
| let mut reload_state = state.clone(); | ||
| reload_state.insn_idx = insn_idx as usize; | ||
| reload_state.pc = unsafe { rb_iseq_pc_at_idx(iseq, insn_idx) }; |
Member
There was a problem hiding this comment.
The reload_state construction logic seems to be repeated 4 times. Can we define a function and use it to deduplicate them?
nozomemein
force-pushed
the
zjit-usesp-reloadlocals
branch
from
April 16, 2026 00:23
2fcf8df to
d609a48
Compare
Contributor
|
Hello and thank you for your PR! Many ZJIT members are at RubyKaigi this week and therefore will be slow to respond due to the conference and the travel associated with it. We will take a look soon! |
k0kubun
approved these changes
Apr 28, 2026
k0kubun
left a comment
Member
There was a problem hiding this comment.
The HIR optimization seems right to me. Thank you!
ima1zumi
pushed a commit
to ima1zumi/ruby
that referenced
this pull request
May 7, 2026
* ZJIT: Use SP for reloading locals * ZJIT: Deduplicate post-send NoEPEscape patch point generation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: Shopify#769
Use
SPfor reloading locals after block-backed send-ish instructions when EP has not escaped.To make that safe, add a
NoEPEscapepatch point before the reload and use a post-send snapshot for side exits, so exiting does not re-execute the send in the interpreter.