Skip to content

ZJIT: Add InvokeSuper and InvokeSuperWithoutBlock#14400

Closed
tekknolagi wants to merge 2 commits intoruby:masterfrom
tekknolagi:mb-invoke-super
Closed

ZJIT: Add InvokeSuper and InvokeSuperWithoutBlock#14400
tekknolagi wants to merge 2 commits intoruby:masterfrom
tekknolagi:mb-invoke-super

Conversation

@tekknolagi
Copy link
Contributor

Support the same limited set of calls as SendWithoutBlock. Don't attempt
to cache yet.

Support the same limited set of calls as SendWithoutBlock. Don't attempt
to cache yet.
@tekknolagi
Copy link
Contributor Author

I don't like this PR as-is. The reason I wanted to split up lookup and invoke instructions is because we can simplify our code: we can have Lookup, LookupSuper, ... and then just Send, SendWithoutBlock. We don't need to fully explode the powerset of combinations (and their optimized variants) into the IR. Ideally we only have ~1 kind of Ruby send that we can analyze, simplify, inline, etc. I don't want to treat invokesuper differently from e.g. invokeblock.

@k0kubun
Copy link
Member

k0kubun commented Sep 3, 2025

That sounds right. YJIT lets those instructions share the same gen_send_iseq/gen_send_cfunc optimizations and we shouldn't give it up in ZJIT.

At the same time, however, all these instructions need separate fallback implementations. We might not need two InvokeSuper* instructions, but we need one for the invokesuper fallback (and another for invokeblock), just like Insn::Send and (non-direct) Insn::SendWithoutBlock.

@tekknolagi
Copy link
Contributor Author

Closing since it looks like you got to it.

@tekknolagi tekknolagi closed this Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants