ruby-changes:69217
From: Alan <ko1@a...>
Date: Thu, 21 Oct 2021 08:23:56 +0900 (JST)
Subject: [ruby-changes:69217] a71590e681 (master): Don't store cfp->pc when doing iseq calls
https://git.ruby-lang.org/ruby.git/commit/?id=a71590e681 From a71590e6814a488a7bfc7e86a59f6782c8a5d276 Mon Sep 17 00:00:00 2001 From: Alan Wu <XrXr@u...> Date: Tue, 14 Sep 2021 11:11:03 -0400 Subject: Don't store cfp->pc when doing iseq calls We set it before calling routines and when we are exiting. --- yjit_codegen.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yjit_codegen.c b/yjit_codegen.c index c4c6011b44..782593a123 100644 --- a/yjit_codegen.c +++ b/yjit_codegen.c @@ -3286,9 +3286,6 @@ gen_send_iseq(jitstate_t *jit, ctx_t *ctx, const struct rb_callinfo *ci, const r https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L3286 return YJIT_CANT_COMPILE; } - // The starting pc of the callee frame - const VALUE *start_pc = &iseq->body->iseq_encoded[start_pc_offset]; - // Number of locals that are not parameters const int num_locals = iseq->body->local_table_size - num_params; @@ -3405,8 +3402,11 @@ gen_send_iseq(jitstate_t *jit, ctx_t *ctx, const struct rb_callinfo *ci, const r https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L3402 mov(cb, member_opnd(REG_CFP, rb_control_frame_t, self), REG0); jit_mov_gc_ptr(jit, cb, REG0, (VALUE)iseq); mov(cb, member_opnd(REG_CFP, rb_control_frame_t, iseq), REG0); - mov(cb, REG0, const_ptr_opnd(start_pc)); - mov(cb, member_opnd(REG_CFP, rb_control_frame_t, pc), REG0); + + // No need to set cfp->pc since the callee sets it whenever calling into routines + // that could look at it through jit_save_pc(). + // mov(cb, REG0, const_ptr_opnd(start_pc)); + // mov(cb, member_opnd(REG_CFP, rb_control_frame_t, pc), REG0); // Stub so we can return to JITted code blockid_t return_block = { jit->iseq, jit_next_insn_idx(jit) }; -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/