summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-12-14 10:49:07 +0900
committerKoichi Sasada <ko1@atdot.net>2020-12-14 11:57:46 +0900
commita8aa169b8f1f89660037c874e8fc2feaf596a43a (patch)
treeb5755d4e288cf400575a35626ef1f0fab17562fc
parent967040ba59799e6b7891168ffbf37cc646988d84 (diff)
add cc_invalidate_negative debug counter
counts for invalidating negative cache.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3892
-rw-r--r--debug_counter.h1
-rw-r--r--vm_method.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/debug_counter.h b/debug_counter.h
index 752a3de02b..5153f73a6a 100644
--- a/debug_counter.h
+++ b/debug_counter.h
@@ -45,6 +45,7 @@ RB_DEBUG_COUNTER(cc_invalidate_leaf_callable) // complime
RB_DEBUG_COUNTER(cc_invalidate_tree) // count for invalidating klass if klass has sublcasses
RB_DEBUG_COUNTER(cc_invalidate_tree_cme) // cme if cme is found in this class or superclasses
RB_DEBUG_COUNTER(cc_invalidate_tree_callable) // complimented cache (subclasses)
+RB_DEBUG_COUNTER(cc_invalidate_negative) // count for invalidating negative cache
RB_DEBUG_COUNTER(ccs_free) // count for free'ing ccs
RB_DEBUG_COUNTER(ccs_maxlen) // maximum length of ccs
diff --git a/vm_method.c b/vm_method.c
index f87c52fc54..122c43556f 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -198,6 +198,8 @@ clear_method_cache_by_id_in_class(VALUE klass, ID mid)
if (rb_id_table_lookup(vm->negative_cme_table, mid, (VALUE *)&cme)) {
rb_id_table_delete(vm->negative_cme_table, mid);
vm_me_invalidate_cache((rb_callable_method_entry_t *)cme);
+
+ RB_DEBUG_COUNTER_INC(cc_invalidate_negative);
}
}
}