985fa1bdaa (master): ZJIT: Share a single JITFrame across all C method frames (#16988)

0 views
Skip to first unread message

Takashi Kokubun

unread,
May 15, 2026, 3:45:09 PM (yesterday) May 15
to ruby...@g.ruby-lang.org
Takashi Kokubun 2026-05-15 19:44:42 +0000 (Fri, 15 May 2026)

New Revision: 985fa1bdaa

https://github.com/ruby/ruby/commit/985fa1bdaa

Log:
ZJIT: Share a single JITFrame across all C method frames (#16988)

* ZJIT: Share a single JITFrame across all C method frames

Replace the per-call JITFrame::new_cfunc allocation in gen_push_frame
with a sentinel value (ZJIT_JIT_RETURN_C_FRAME) stored in cfp->jit_return.
CFP_ZJIT_FRAME now returns a pointer to a single static rb_zjit_c_frame
(pc/iseq both NULL) when it sees the sentinel.

The CFP accessor is split into CFP_ZJIT_FRAME_P (predicate) and
CFP_ZJIT_FRAME (typed accessor that dereferences safely) so callers don't
have to know about the sentinel encoding. ISEQ frames are unchanged: they
still hand cfp->jit_return a heap-allocated JITFrame pointer.

* Move a pointer location for CFP_ZJIT_FRAME

Modified files:
vm.c
zjit.c
zjit.h
zjit/bindgen/src/main.rs
zjit/src/codegen.rs
zjit/src/cruby_bindings.inc.rs
zjit/src/jit_frame.rs
Reply all
Reply to author
Forward
0 new messages