mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add debug counters for local variable (lavr) access.
* debug_counter.h: add the following counters: * lvar_get: counter for lvar get. * lvar_get_dynamic: counter for lvar get from upper frames. * lvar_set: coutner for lvar set. * lvar_set_dynamic: coutner for lvar set from upper frames. * lvar_set_slowpath: counter for lavr set using slowpath. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
76bca90c5b
commit
cc50ed4a50
3 changed files with 15 additions and 0 deletions
|
@ -13,6 +13,8 @@
|
|||
#endif
|
||||
|
||||
#ifdef RB_DEBUG_COUNTER
|
||||
|
||||
/* method search */
|
||||
RB_DEBUG_COUNTER(mc_inline_hit)
|
||||
RB_DEBUG_COUNTER(mc_inline_miss)
|
||||
RB_DEBUG_COUNTER(mc_global_hit)
|
||||
|
@ -23,6 +25,7 @@ RB_DEBUG_COUNTER(mc_cme_complement)
|
|||
RB_DEBUG_COUNTER(mc_cme_complement_hit)
|
||||
RB_DEBUG_COUNTER(mc_search_super)
|
||||
|
||||
/* ivar access */
|
||||
RB_DEBUG_COUNTER(ivar_get_ic_hit)
|
||||
RB_DEBUG_COUNTER(ivar_get_ic_miss)
|
||||
RB_DEBUG_COUNTER(ivar_get_ic_miss_serial)
|
||||
|
@ -37,6 +40,13 @@ RB_DEBUG_COUNTER(ivar_set_ic_miss_noobject)
|
|||
RB_DEBUG_COUNTER(ivar_get_base)
|
||||
RB_DEBUG_COUNTER(ivar_set_base)
|
||||
|
||||
/* lvar access */
|
||||
RB_DEBUG_COUNTER(lvar_get)
|
||||
RB_DEBUG_COUNTER(lvar_get_dynamic)
|
||||
RB_DEBUG_COUNTER(lvar_set)
|
||||
RB_DEBUG_COUNTER(lvar_set_dynamic)
|
||||
RB_DEBUG_COUNTER(lvar_set_slowpath)
|
||||
|
||||
/* object counts */
|
||||
RB_DEBUG_COUNTER(obj_free)
|
||||
|
||||
|
|
|
@ -58,6 +58,8 @@ getlocal
|
|||
(VALUE val)
|
||||
{
|
||||
val = *(vm_get_ep(GET_EP(), level) - idx);
|
||||
RB_DEBUG_COUNTER_INC(lvar_get);
|
||||
(void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,6 +76,8 @@ setlocal
|
|||
()
|
||||
{
|
||||
vm_env_write(vm_get_ep(GET_EP(), level), -(int)idx, val);
|
||||
RB_DEBUG_COUNTER_INC(lvar_set);
|
||||
(void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -320,6 +320,7 @@ vm_env_write_slowpath(const VALUE *ep, int index, VALUE v)
|
|||
rb_gc_writebarrier_remember(VM_ENV_ENVVAL(ep));
|
||||
VM_FORCE_WRITE(&ep[index], v);
|
||||
VM_ENV_FLAGS_UNSET(ep, VM_ENV_FLAG_WB_REQUIRED);
|
||||
RB_DEBUG_COUNTER_INC(lvar_set_slowpath);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
Loading…
Reference in a new issue