Skip to content

ZJIT: Split Send into Lookup+Call #13400

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tekknolagi
Copy link
Contributor

@tekknolagi tekknolagi commented May 21, 2025

Split SendWithoutBlock{,Direct} into LookupMethod and CallMethod. From there,
centralize the profile- and type-driven rewrites to one function:
optimize_lookup_method. This determines if we know the call target at compile
time.

Then, we can rewrite CallMethod to do something with a known-constant target.
If we know it at compile-time, we can specialize to CallCFunc or CallIseq
(or more, like a hypothetical GetInstanceVariable, in the future).

Also,

  • Add CmePtr as type alias alias
  • Add CallableMethodEntry to type lattice
  • Make CallData an alias for *const rb_call_data

Co-authored-by: Aaron Patterson tenderlove@ruby-lang.org

@tekknolagi tekknolagi changed the title Split Send into Lookup+Call ZJIT: Split Send into Lookup+Call May 21, 2025
@matzbot matzbot requested a review from a team May 21, 2025 14:53
@tekknolagi
Copy link
Contributor Author

I will absolutely be cleaning up the commits in this PR for rebasing

@tekknolagi
Copy link
Contributor Author

Also, I need to figure out some stuff before landing like a codegen implementation of CallMethod (is there a nice C function for this?) and a couple of other TODOs sprinkled throughout the changes

@k0kubun
Copy link
Member

k0kubun commented May 22, 2025

Is it intentional that the ZJIT CI is failing at the moment?

@tekknolagi
Copy link
Contributor Author

Well it's not exactly intentional but I don't have codegen for CallMethod because I can't figure out a way to do it yet :( It's currently crashing/assert failing/...

@tekknolagi
Copy link
Contributor Author

But if you have feedback on the rest of the (admittedly big, kind of disorganized) PR separate from that, I would be interested. The CallMethod codegen is hopefully separate/isolated enough

Copy link

launchable-app bot commented Jun 6, 2025

Tests Failed

✖️no tests failed ✔️61990 tests passed(1 flake)

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