Skip to content

Commit 7c75dbe

Browse files
authored
ZJIT: Reset all the counters in RubyVM::ZJIT::reset_stats! (ruby#15950)
We previously forgot about these.
1 parent e7e9303 commit 7c75dbe

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

zjit/src/stats.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,21 @@ pub extern "C" fn rb_zjit_reset_stats_bang(_ec: EcPtr, _self: VALUE) -> VALUE {
717717
// Reset exit counters for YARV instructions
718718
exit_counters.as_mut_slice().fill(0);
719719

720+
// Reset send fallback counters
721+
ZJITState::get_send_fallback_counters().as_mut_slice().fill(0);
722+
723+
// Reset not-inlined counters
724+
ZJITState::get_not_inlined_cfunc_counter_pointers().iter_mut()
725+
.for_each(|b| { **(b.1) = 0; });
726+
727+
// Reset not-annotated counters
728+
ZJITState::get_not_annotated_cfunc_counter_pointers().iter_mut()
729+
.for_each(|b| { **(b.1) = 0; });
730+
731+
// Reset ccall counters
732+
ZJITState::get_ccall_counter_pointers().iter_mut()
733+
.for_each(|b| { **(b.1) = 0; });
734+
720735
Qnil
721736
}
722737

0 commit comments

Comments
 (0)