Thanks to visit codestin.com
Credit goes to github.com

Skip to content

YJIT: ZJIT: Share identical glue functions #13229

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

Merged
merged 2 commits into from
May 2, 2025
Merged

Conversation

XrXr
Copy link
Member

@XrXr XrXr commented May 1, 2025

  • Add include guards for insns_info.inc

  • YJIT: ZJIT: Share identical glue functions

    Working towards having YJIT and ZJIT in the same build, we need to
    deduplicate some glue code that would otherwise cause name collision.
    Add jit.c for this and build it for YJIT and ZJIT builds. Update bindgen
    to look at jit.c; some shuffling of functions in the output, but the set
    of functions shouldn't have changed.

@XrXr XrXr marked this pull request as ready for review May 1, 2025 10:46
@matzbot matzbot requested a review from a team May 1, 2025 10:46
@XrXr XrXr force-pushed the share-jit-glue branch from 4c37717 to 439195d Compare May 1, 2025 10:48
@k0kubun
Copy link
Member

k0kubun commented May 1, 2025

I feel hesitant to include the name "glue" in the file name because people may put any future JIT glue code there, but we should probably use yjit.c or zjit.c if it's not shared.

Can we just call it jit.c? It should have functions that are shared by YJIT and ZJIT and would otherwise be defined in yjit.c or zjit.c. So just dropping y or z from the file name and not adding anything makes more sense to me.

@tekknolagi
Copy link
Contributor

Also: do we want to keep an rb_jit prefix for functions in jit.c?

@XrXr XrXr force-pushed the share-jit-glue branch from 439195d to 65f8bc7 Compare May 2, 2025 11:21
@XrXr
Copy link
Member Author

XrXr commented May 2, 2025

Renamed to jit.c and amended comment to warn against putting JIT specific stuff in jit.c.

do we want to keep an rb_jit prefix for functions in jit.c?

Since these are for super simple operations, like reading off of a bit field, the extra prefex feel too heavy weight to me. (Similar reasoning for wrappers of static functions.)

The JIT bindgens need this.
@XrXr XrXr force-pushed the share-jit-glue branch from 4c09479 to d044b27 Compare May 2, 2025 11:26
@XrXr XrXr requested a review from Copilot May 2, 2025 11:34
Copilot

This comment was marked as resolved.

Working towards having YJIT and ZJIT in the same build, we need to
deduplicate some glue code that would otherwise cause name collision.
Add jit.c for this and build it for YJIT and ZJIT builds. Update bindgen
to look at jit.c; some shuffling of functions in the output, but the set
of functions shouldn't have changed.
@XrXr XrXr force-pushed the share-jit-glue branch from d044b27 to ce61abf Compare May 2, 2025 11:43
Copy link

launchable-app bot commented May 2, 2025

All Tests passed!

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

@XrXr XrXr merged commit 33909a1 into ruby:master May 2, 2025
83 checks passed
@XrXr XrXr deleted the share-jit-glue branch May 2, 2025 14:47
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.

3 participants