diff --git a/debug_counter.c b/debug_counter.c index b9c32c1d15..f17fb1c488 100644 --- a/debug_counter.c +++ b/debug_counter.c @@ -51,6 +51,7 @@ rb_debug_counter_reset(void) case RB_DEBUG_COUNTER_mjit_length_unit_queue: case RB_DEBUG_COUNTER_mjit_length_active_units: case RB_DEBUG_COUNTER_mjit_length_compact_units: + case RB_DEBUG_COUNTER_mjit_length_stale_units: // These counters may be decreased and should not be reset. break; default: diff --git a/debug_counter.h b/debug_counter.h index 8510bb90f8..d15330f559 100644 --- a/debug_counter.h +++ b/debug_counter.h @@ -280,6 +280,7 @@ RB_DEBUG_COUNTER(mjit_cancel_trace) RB_DEBUG_COUNTER(mjit_length_unit_queue) RB_DEBUG_COUNTER(mjit_length_active_units) RB_DEBUG_COUNTER(mjit_length_compact_units) +RB_DEBUG_COUNTER(mjit_length_stale_units) /* Other MJIT counters */ RB_DEBUG_COUNTER(mjit_compile_failures) diff --git a/mjit_worker.c b/mjit_worker.c index 06d259bc06..be0910b611 100644 --- a/mjit_worker.c +++ b/mjit_worker.c @@ -334,6 +334,7 @@ add_to_list(struct rb_mjit_unit *unit, struct rb_mjit_unit_list *list) (void)RB_DEBUG_COUNTER_INC_IF(mjit_length_unit_queue, list == &unit_queue); (void)RB_DEBUG_COUNTER_INC_IF(mjit_length_active_units, list == &active_units); (void)RB_DEBUG_COUNTER_INC_IF(mjit_length_compact_units, list == &compact_units); + (void)RB_DEBUG_COUNTER_INC_IF(mjit_length_stale_units, list == &stale_units); list_add_tail(&list->head, &unit->unode); list->length++; @@ -346,6 +347,7 @@ remove_from_list(struct rb_mjit_unit *unit, struct rb_mjit_unit_list *list) rb_debug_counter_add(RB_DEBUG_COUNTER_mjit_length_unit_queue, -1, list == &unit_queue); rb_debug_counter_add(RB_DEBUG_COUNTER_mjit_length_active_units, -1, list == &active_units); rb_debug_counter_add(RB_DEBUG_COUNTER_mjit_length_compact_units, -1, list == &compact_units); + rb_debug_counter_add(RB_DEBUG_COUNTER_mjit_length_stale_units, -1, list == &stale_units); #endif list_del(&unit->unode);