diff options
-rw-r--r-- | debug_counter.h | 3 | ||||
-rw-r--r-- | mjit_worker.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/debug_counter.h b/debug_counter.h index 82eab936d1..f0de6d2cb6 100644 --- a/debug_counter.h +++ b/debug_counter.h @@ -275,6 +275,9 @@ RB_DEBUG_COUNTER(mjit_length_unit_queue) RB_DEBUG_COUNTER(mjit_length_active_units) RB_DEBUG_COUNTER(mjit_length_compact_units) +/* Other MJIT counters */ +RB_DEBUG_COUNTER(mjit_compile_failures) + /* load (not implemented yet) */ /* RB_DEBUG_COUNTER(load_files) diff --git a/mjit_worker.c b/mjit_worker.c index 51acac3471..c651809ac5 100644 --- a/mjit_worker.c +++ b/mjit_worker.c @@ -1241,6 +1241,7 @@ mjit_worker(void) if (unit) { // JIT compile mjit_func_t func = convert_unit_to_func(unit); + RB_DEBUG_COUNTER_INC_IF(mjit_compile_failures, func == (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC); // `mjit_copy_cache_from_main_thread` in `mjit_compile` may wait for a long time // and worker may be stopped during the compilation. |