summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-28 01:10:43 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-28 01:10:43 (GMT)
commitdf5ec4107d6c91fba05fb7cadac82c2371aec152 (patch)
tree2afeb4995ee59d5b0ae1da433a51dfb6da0c0cc7 /vm_insnhelper.c
parent0e3e0f824966c9c05870b2dbac88c0a8eef2b579 (diff)
add debug counters more.
* debug_counter.h: add the following counters. * frame_push: control frame counts (total counts). * frame_push_*: control frame counts per every frame type. * obj_*: add free'ed counts for each type. * gc.c: ditto. * vm_insnhelper.c (vm_push_frame): ditto. * debug_counter.c (rb_debug_counter_show_results): widen counts field to show >10G numbers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 29e6545..54940ea 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -214,6 +214,21 @@ vm_push_frame(rb_execution_context_t *ec,
rb_control_frame_t *const cfp = ec->cfp - 1;
int i;
+#if USE_DEBUG_COUNTER
+ RB_DEBUG_COUNTER_INC(frame_push);
+ switch (type & VM_FRAME_MAGIC_MASK) {
+ case VM_FRAME_MAGIC_METHOD: RB_DEBUG_COUNTER_INC(frame_push_method); break;
+ case VM_FRAME_MAGIC_BLOCK: RB_DEBUG_COUNTER_INC(frame_push_block); break;
+ case VM_FRAME_MAGIC_CLASS: RB_DEBUG_COUNTER_INC(frame_push_class); break;
+ case VM_FRAME_MAGIC_TOP: RB_DEBUG_COUNTER_INC(frame_push_top); break;
+ case VM_FRAME_MAGIC_CFUNC: RB_DEBUG_COUNTER_INC(frame_push_cfunc); break;
+ case VM_FRAME_MAGIC_IFUNC: RB_DEBUG_COUNTER_INC(frame_push_ifunc); break;
+ case VM_FRAME_MAGIC_EVAL: RB_DEBUG_COUNTER_INC(frame_push_eval); break;
+ case VM_FRAME_MAGIC_RESCUE: RB_DEBUG_COUNTER_INC(frame_push_rescue); break;
+ case VM_FRAME_MAGIC_DUMMY: RB_DEBUG_COUNTER_INC(frame_push_dummy); break;
+ default: rb_bug("unreachable");
+ }
+#endif
vm_check_frame(type, specval, cref_or_me, iseq);
VM_ASSERT(local_size >= 0);