Skip to content

Commit 98790fa

Browse files
committed
YJIT: Add Counter::invalidate_everything
When YJIT is forced to discard all the code, that's bad for performance, so there should be an easy way to know about it.
1 parent 3c92fe1 commit 98790fa

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

yjit/src/invariants.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,8 @@ pub extern "C" fn rb_yjit_tracing_invalidate_all() {
626626
return;
627627
}
628628

629+
incr_counter!(invalidate_everything);
630+
629631
// Stop other ractors since we are going to patch machine code.
630632
with_vm_lock(src_loc!(), || {
631633
// Make it so all live block versions are no longer valid branch targets

yjit/src/stats.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ pub const DEFAULT_COUNTERS: &'static [Counter] = &[
293293
Counter::invalidate_constant_ic_fill,
294294
Counter::invalidate_no_singleton_class,
295295
Counter::invalidate_ep_escape,
296+
Counter::invalidate_everything,
296297
];
297298

298299
/// Macro to increase a counter by name and count
@@ -589,6 +590,7 @@ make_counters! {
589590
invalidate_constant_ic_fill,
590591
invalidate_no_singleton_class,
591592
invalidate_ep_escape,
593+
invalidate_everything,
592594

593595
// Currently, it's out of the ordinary (might be impossible) for YJIT to leave gaps in
594596
// executable memory, so this should be 0.

0 commit comments

Comments
 (0)