[前][次][番号順一覧][スレッド一覧]

ruby-changes:63562

From: Aaron <ko1@a...>
Date: Tue, 10 Nov 2020 07:06:03 +0900 (JST)
Subject: [ruby-changes:63562] 4219cb7adb (master): Add debug counter for ivar inline cache misses that could hit

https://git.ruby-lang.org/ruby.git/commit/?id=4219cb7adb

From 4219cb7adb0240fa92cd044b2feebb66b7702ca1 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Mon, 9 Nov 2020 11:59:18 -0800
Subject: Add debug counter for ivar inline cache misses that could hit

This commit adds a debug counter for the case where the inline cache
*missed* but the ivar index table has an entry for that ivar.  This is a
case where a polymorphic cache could help

diff --git a/debug_counter.h b/debug_counter.h
index 9f7a817..752a3de 100644
--- a/debug_counter.h
+++ b/debug_counter.h
@@ -123,6 +123,7 @@ RB_DEBUG_COUNTER(ivar_set_ic_hit) https://github.com/ruby/ruby/blob/trunk/debug_counter.h#L123
 RB_DEBUG_COUNTER(ivar_set_ic_miss)
 RB_DEBUG_COUNTER(ivar_set_ic_miss_serial)
 RB_DEBUG_COUNTER(ivar_set_ic_miss_unset)
+RB_DEBUG_COUNTER(ivar_set_ic_miss_iv_hit)
 RB_DEBUG_COUNTER(ivar_set_ic_miss_noobject)
 RB_DEBUG_COUNTER(ivar_get_base)
 RB_DEBUG_COUNTER(ivar_set_base)
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index ea25de6..74e992a 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1246,6 +1246,7 @@ vm_setivar(VALUE obj, ID id, VALUE val, const rb_iseq_t *iseq, IVC ic, const str https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1246
                     ptr = ROBJECT_IVPTR(obj);
                 }
                 RB_OBJ_WRITE(obj, &ptr[index], val);
+                RB_DEBUG_COUNTER_INC(ivar_set_ic_miss_iv_hit);
 
                 return val;
 	    }
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]