Skip to content

ZJIT: Export build-dependent struct offsets as a const table - #18256

Merged
k0kubun merged 2 commits into
ruby:masterfrom
k0kubun:zjit-runtime-offsets
Aug 7, 2026
Merged

ZJIT: Export build-dependent struct offsets as a const table#18256
k0kubun merged 2 commits into
ruby:masterfrom
k0kubun:zjit-runtime-offsets

Conversation

@k0kubun

@k0kubun k0kubun commented Aug 7, 2026

Copy link
Copy Markdown
Member

I propose an alternative to how we currently import offsets that very between x86_64 and arm64 #18241 (comment). Instead of defining a C function for every offset in the Ractor struct, this PR defines a const struct compiled by the C compiler, which is readable without a C call from Rust.

This is probably performance-neutral, if not slightly faster, but you will no longer need to enumerate these function names in ‎zjit/src/cruby.rs (or zjit/bindgen/src/main.rs‎) anymore. Just modifying zjit.c alone would let make zjit-bindgen import new offsets, which takes less effort than the current setup.

@github-actions github-actions Bot added the jit YJIT, ZJIT, ... label Aug 7, 2026
@k0kubun
k0kubun marked this pull request as ready for review August 7, 2026 19:55
@matzbot
matzbot requested a review from a team August 7, 2026 19:56
# Conflicts:
#	zjit.c
#	zjit/src/codegen/gc_fastpath.rs
@k0kubun
k0kubun merged commit 87a30df into ruby:master Aug 7, 2026
113 checks passed
@k0kubun
k0kubun deleted the zjit-runtime-offsets branch August 7, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jit YJIT, ZJIT, ...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants