Skip to content

ZJIT: Disable ZJIT instructions when USE_ZJIT is 0 #13199

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 4 commits into from
Apr 29, 2025

Conversation

k0kubun
Copy link
Member

@k0kubun k0kubun commented Apr 28, 2025

As requested by Koichi at RubyKaigi, this PR stops defining ZJIT instructions when ZJIT is disabled for the build.

@k0kubun k0kubun marked this pull request as ready for review April 29, 2025 00:55
@matzbot matzbot requested a review from a team April 29, 2025 00:55
@tekknolagi
Copy link
Contributor

Seems reasonable. Does this implicitly rely on the zjit instructions a) being contiguous and b) being reliably ordered after all the other instructions?

@XrXr
Copy link
Member

XrXr commented Apr 29, 2025

Thanks! I was a bit worried about making the interpreter loop function overly big for non users too.

Copy link
Member

@XrXr XrXr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, can you toss in a --disable-zjit build in .github/workflows/compilers.yml for good measure?

@k0kubun
Copy link
Member Author

k0kubun commented Apr 29, 2025

Does this implicitly rely on the zjit instructions a) being contiguous and b) being reliably ordered after all the other instructions?

Yes, it does. I added tests for the assumption d67294e.

I initially printed #if 1 or #if USE_ZJIT for every instruction, but it made the source code in the distributed package harder to read. Also the offset calculation would be much harder to implement if we didn't rely on it.

Ah, can you toss in a --disable-zjit build in .github/workflows/compilers.yml for good measure?

done 932f29c

This comment has been minimized.

@k0kubun k0kubun enabled auto-merge (squash) April 29, 2025 17:57
@k0kubun k0kubun disabled auto-merge April 29, 2025 18:03
@k0kubun k0kubun merged commit 0f3d6ee into ruby:master Apr 29, 2025
78 of 79 checks passed
@k0kubun k0kubun deleted the zjit-disable branch April 29, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants