diff options
author | Alan Wu <[email protected]> | 2024-05-06 10:28:36 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-06 10:28:36 -0400 |
commit | 1df1edc080031b8f18b41a5a8d308a667ea89fc1 (patch) | |
tree | d49ba3e8aa435915c01176e3bd4b3126a7be2db2 /yjit/src | |
parent | a5cb8c8c5ba61a82c950843c57679fc135762b07 (diff) |
YJIT: Fix comment and counter in rb_yjit_invalidate_ep_is_bp() (#10722)
`mem::take` substitutes an empty instance which makes `jit.ep_is_bp()`
return false.
Diffstat (limited to 'yjit/src')
-rw-r--r-- | yjit/src/invariants.rs | 5 | ||||
-rw-r--r-- | yjit/src/stats.rs | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/yjit/src/invariants.rs b/yjit/src/invariants.rs index 695a37878f..6639fd677b 100644 --- a/yjit/src/invariants.rs +++ b/yjit/src/invariants.rs @@ -584,11 +584,10 @@ pub extern "C" fn rb_yjit_invalidate_ep_is_bp(iseq: IseqPtr) { let no_ep_escape_iseqs = &mut Invariants::get_instance().no_ep_escape_iseqs; match no_ep_escape_iseqs.get_mut(&iseq) { Some(blocks) => { - // Invalidate existing blocks and let jit.ep_is_bp() - // return true when they are compiled again + // Invalidate existing blocks and make jit.ep_is_bp() return false for block in mem::take(blocks) { invalidate_block_version(&block); - incr_counter!(invalidate_no_singleton_class); + incr_counter!(invalidate_ep_escape); } } None => { diff --git a/yjit/src/stats.rs b/yjit/src/stats.rs index 0a63fab8b0..6ffe28f12a 100644 --- a/yjit/src/stats.rs +++ b/yjit/src/stats.rs @@ -268,7 +268,7 @@ macro_rules! make_counters { /// The list of counters that are available without --yjit-stats. /// They are incremented only by `incr_counter!` and don't use `gen_counter_incr`. -pub const DEFAULT_COUNTERS: [Counter; 16] = [ +pub const DEFAULT_COUNTERS: [Counter; 17] = [ Counter::code_gc_count, Counter::compiled_iseq_entry, Counter::cold_iseq_entry, @@ -286,6 +286,7 @@ pub const DEFAULT_COUNTERS: [Counter; 16] = [ Counter::invalidate_constant_state_bump, Counter::invalidate_constant_ic_fill, Counter::invalidate_no_singleton_class, + Counter::invalidate_ep_escape, ]; /// Macro to increase a counter by name and count @@ -568,6 +569,7 @@ make_counters! { invalidate_constant_state_bump, invalidate_constant_ic_fill, invalidate_no_singleton_class, + invalidate_ep_escape, // Currently, it's out of the ordinary (might be impossible) for YJIT to leave gaps in // executable memory, so this should be 0. |