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

ruby-changes:64134

From: Koichi <ko1@a...>
Date: Mon, 14 Dec 2020 11:58:09 +0900 (JST)
Subject: [ruby-changes:64134] a8aa169b8f (master): add cc_invalidate_negative debug counter

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

From a8aa169b8f1f89660037c874e8fc2feaf596a43a Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Mon, 14 Dec 2020 10:49:07 +0900
Subject: add cc_invalidate_negative debug counter

counts for invalidating negative cache.

diff --git a/debug_counter.h b/debug_counter.h
index 752a3de..5153f73 100644
--- a/debug_counter.h
+++ b/debug_counter.h
@@ -45,6 +45,7 @@ RB_DEBUG_COUNTER(cc_invalidate_leaf_callable) //                        complime https://github.com/ruby/ruby/blob/trunk/debug_counter.h#L45
 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 f87c52f..122c435 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -198,6 +198,8 @@ clear_method_cache_by_id_in_class(VALUE klass, ID mid) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L198
             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);
             }
         }
     }
-- 
cgit v0.10.2


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

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