From 0601ba6a1bf15e13ac931921861c90535ed29dde Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 9 Feb 2023 07:38:31 -0800 Subject: [PATCH] YJIT: Add counter for megamorphic send (#7274) --- yjit/src/codegen.rs | 4 +++- yjit/src/stats.rs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 9925568c35..be055c011b 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -5931,6 +5931,8 @@ fn gen_send_general( // Points to the receiver operand on the stack let recv = ctx.stack_opnd(recv_idx); let recv_opnd = StackOpnd(recv_idx.try_into().unwrap()); + + let megamorphic_exit = counted_exit!(ocb, side_exit, send_klass_megamorphic); jit_guard_known_klass( jit, ctx, @@ -5941,7 +5943,7 @@ fn gen_send_general( recv_opnd, comptime_recv, SEND_MAX_DEPTH, - side_exit, + megamorphic_exit, ); // Do method lookup diff --git a/yjit/src/stats.rs b/yjit/src/stats.rs index e9408b71c7..9fff7f0e27 100644 --- a/yjit/src/stats.rs +++ b/yjit/src/stats.rs @@ -168,6 +168,7 @@ make_counters! { exec_instruction, send_keywords, + send_klass_megamorphic, send_kw_splat, send_args_splat_super, send_iseq_zsuper,