summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debug_counter.h6
-rw-r--r--mjit.h10
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)
diff --git a/mjit.h b/mjit.h
index 4b4d7cce47..6fb15b402c 100644
--- a/mjit.h
+++ b/mjit.h
@@ -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);
}