ruby-changes:69005
From: John <ko1@a...>
Date: Thu, 21 Oct 2021 08:19:39 +0900 (JST)
Subject: [ruby-changes:69005] d77c989ac7 (master): Fix check for leaf invokebuiltin
https://git.ruby-lang.org/ruby.git/commit/?id=d77c989ac7 From d77c989ac73274a0908746c0f861fb8936f64dfc Mon Sep 17 00:00:00 2001 From: John Hawthorn <john@h...> Date: Fri, 4 Jun 2021 16:49:50 -0700 Subject: Fix check for leaf invokebuiltin Also added a comment when inlining a leaf builtin --- yjit_codegen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yjit_codegen.c b/yjit_codegen.c index 847bb57e0d..26a718ef32 100644 --- a/yjit_codegen.c +++ b/yjit_codegen.c @@ -2460,8 +2460,7 @@ rb_leaf_invokebuiltin_iseq_p(const rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L2460 unsigned int invokebuiltin_len = insn_len(BIN(opt_invokebuiltin_delegate_leave)); unsigned int leave_len = insn_len(BIN(leave)); - return iseq->body->iseq_size == ( - (invokebuiltin_len + leave_len) && + return (iseq->body->iseq_size == (invokebuiltin_len + leave_len) && rb_vm_insn_addr2opcode((void *)iseq->body->iseq_encoded[0]) == BIN(opt_invokebuiltin_delegate_leave) && rb_vm_insn_addr2opcode((void *)iseq->body->iseq_encoded[invokebuiltin_len]) == BIN(leave) && iseq->body->builtin_inline_p @@ -2546,6 +2545,8 @@ 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#L2545 const struct rb_builtin_function *leaf_builtin = rb_leaf_builtin_function(iseq); if (leaf_builtin && !block && leaf_builtin->argc + 1 <= NUM_C_ARG_REGS) { + ADD_COMMENT(cb, "inlined leaf builtin"); + // TODO: figure out if this is necessary // If the calls don't allocate, do they need up to date PC, SP? // Save YJIT registers -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/