diff options
-rw-r--r-- | debug_counter.h | 6 | ||||
-rw-r--r-- | mjit.h | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/debug_counter.h b/debug_counter.h index f0de6d2cb6..b28efb3278 100644 --- a/debug_counter.h +++ b/debug_counter.h @@ -263,6 +263,12 @@ RB_DEBUG_COUNTER(mjit_exec_not_ready) RB_DEBUG_COUNTER(mjit_exec_not_compiled) RB_DEBUG_COUNTER(mjit_exec_call_func) +/* MJIT <-> VM frame push counts */ +RB_DEBUG_COUNTER(mjit_frame_VM2VM) +RB_DEBUG_COUNTER(mjit_frame_VM2JT) +RB_DEBUG_COUNTER(mjit_frame_JT2JT) +RB_DEBUG_COUNTER(mjit_frame_JT2VM) + /* MJIT cancel counters */ RB_DEBUG_COUNTER(mjit_cancel) RB_DEBUG_COUNTER(mjit_cancel_ivar) @@ -110,6 +110,11 @@ mjit_exec(rb_execution_context_t *ec) func = body->jit_func; if (UNLIKELY((uintptr_t)func <= (uintptr_t)LAST_JIT_ISEQ_FUNC)) { +# ifdef MJIT_HEADER + RB_DEBUG_COUNTER_INC(mjit_frame_JT2VM); +# else + RB_DEBUG_COUNTER_INC(mjit_frame_VM2VM); +# endif switch ((enum rb_mjit_iseq_func)func) { case NOT_ADDED_JIT_ISEQ_FUNC: RB_DEBUG_COUNTER_INC(mjit_exec_not_added); @@ -132,6 +137,11 @@ mjit_exec(rb_execution_context_t *ec) } } +# ifdef MJIT_HEADER + RB_DEBUG_COUNTER_INC(mjit_frame_JT2JT); +# else + RB_DEBUG_COUNTER_INC(mjit_frame_VM2JT); +# endif RB_DEBUG_COUNTER_INC(mjit_exec_call_func); return func(ec, ec->cfp); } |