Skip to content

[pull] master from ruby:master#957

Merged
pull[bot] merged 2 commits intoturkdevops:masterfrom
ruby:master
Apr 23, 2026
Merged

[pull] master from ruby:master#957
pull[bot] merged 2 commits intoturkdevops:masterfrom
ruby:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 23, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

While working on implementing a new inliner for ZJIT, I keep running into an issue where the wrong iseq pointer is being used. Since `JITState#iseq` and `FrameState#iseq` end up being the same value in the absence of inlining, I don't think we've been all that rigorous about using the "correct" one in a given context. I've been migrating to `FrameState#iseq` in my inliner work and adapting on each rebase. But, having looked at this code for a little while, I think we can remove `JITState#iseq`.

This PR switches to using `FrameState#iseq` in cases where we're working with the code associated with a specific frame (e.g., local-table layout, side-exit resumption target) rather than the overall compilation unit. Other cases are cleaned up by either storing the iseq on the instruction or computing the value that required the iseq and storing that in the instruction.

Without inlining, this change set is really just a clean-up of what we have today. With inlining, however, these changes become semantically meaningful. Making the change now removes the decision point of when to use `JITState#iseq` vs `FrameState#iseq` and simplifies keeping the inliner work current with _master_.


* ZJIT: Use `FrameState#iseq` for variable-access codegen

* ZJIT: Use `FrameState#iseq` for `IsMethodCfunc` codegen

* ZJIT: Precompute LEP level for defined?(yield) at HIR construction

Rather than use `JITState#iseq` to compute the LEP level during codegen, we can compute it once and store it at HIR construction.

* ZJIT: Use `FrameState#iseq` for local spills and side-exit reconstruction

Previously, we were using `JITState#iseq`, but these call sites are more about the frame state rather than the outer compilation unit.

* ZJIT: Remove the unused iseq field from JITState
@pull pull Bot locked and limited conversation to collaborators Apr 23, 2026
@pull pull Bot added the ⤵️ pull label Apr 23, 2026
@pull pull Bot merged commit 7d4941d into turkdevops:master Apr 23, 2026
0 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant