ruby-changes:69233
From: eileencodes <ko1@a...>
Date: Thu, 21 Oct 2021 08:24:18 +0900 (JST)
Subject: [ruby-changes:69233] f911e264a1 (master): Add counted side exit to getblockparamproxy
https://git.ruby-lang.org/ruby.git/commit/?id=f911e264a1 From f911e264a1d539b6c99542d07f72af10ed91ae87 Mon Sep 17 00:00:00 2001 From: eileencodes <eileencodes@g...> Date: Fri, 1 Oct 2021 13:43:00 -0400 Subject: Add counted side exit to getblockparamproxy This is so we know the specific reason we're exiting this instruction. Co-authored-by: Aaron Patterson tenderlove@r... --- yjit_codegen.c | 4 ++-- yjit_iface.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/yjit_codegen.c b/yjit_codegen.c index c4dba156cb..9cc643654b 100644 --- a/yjit_codegen.c +++ b/yjit_codegen.c @@ -4191,7 +4191,7 @@ gen_getblockparamproxy(jitstate_t *jit, ctx_t *ctx, codeblock_t *cb) https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L4191 // Bail when VM_ENV_FLAGS(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM) is non zero test(cb, mem_opnd(64, REG0, SIZEOF_VALUE * VM_ENV_DATA_INDEX_FLAGS), imm_opnd(VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM)); - jnz_ptr(cb, side_exit); + jnz_ptr(cb, COUNTED_EXIT(side_exit, block_param_is_modified)); // Load the block handler for the current frame // note, VM_ASSERT(VM_ENV_LOCAL_P(ep)) @@ -4202,7 +4202,7 @@ gen_getblockparamproxy(jitstate_t *jit, ctx_t *ctx, codeblock_t *cb) https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L4202 // Bail unless VM_BH_ISEQ_BLOCK_P(bh). This also checks for null. cmp(cb, REG0_8, imm_opnd(0x1)); - jne_ptr(cb, side_exit); + jnz_ptr(cb, COUNTED_EXIT(side_exit, block_handler_is_not_iseq)); // Push rb_block_param_proxy. It's a root, so no need to use jit_mov_gc_ptr. mov(cb, REG0, const_ptr_opnd((void *)rb_block_param_proxy)); diff --git a/yjit_iface.h b/yjit_iface.h index de6c94da9a..639c728c0c 100644 --- a/yjit_iface.h +++ b/yjit_iface.h @@ -107,6 +107,9 @@ YJIT_DECLARE_COUNTERS( https://github.com/ruby/ruby/blob/trunk/yjit_iface.h#L107 expandarray_not_array, expandarray_rhs_too_small, + block_param_is_modified, + block_handler_is_not_iseq, + // Member with known name for iterating over counters last_member ) -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/