From 6002b12611c3cee921fc8aef76b55db4b2d0fbcd Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sun, 2 Apr 2023 15:26:46 -0700 Subject: RJIT: Support entry with different PCs --- rjit.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'rjit.c') diff --git a/rjit.c b/rjit.c index b9f11a0800..f1d3440ce9 100644 --- a/rjit.c +++ b/rjit.c @@ -360,6 +360,26 @@ rb_rjit_compile(const rb_iseq_t *iseq) RB_VM_LOCK_LEAVE(); } +void * +rb_rjit_entry_stub_hit(VALUE branch_stub) +{ + VALUE result; + + RB_VM_LOCK_ENTER(); + rb_vm_barrier(); + + rb_control_frame_t *cfp = GET_EC()->cfp; + + WITH_RJIT_ISOLATED({ + VALUE cfp_ptr = rb_funcall(rb_cRJITCfpPtr, rb_intern("new"), 1, SIZET2NUM((size_t)cfp)); + result = rb_funcall(rb_RJITCompiler, rb_intern("entry_stub_hit"), 2, branch_stub, cfp_ptr); + }); + + RB_VM_LOCK_LEAVE(); + + return (void *)NUM2SIZET(result); +} + void * rb_rjit_branch_stub_hit(VALUE branch_stub, int sp_offset, int target0_p) { -- cgit v1.2.1