Skip to content

Commit

Permalink
YJIT: Fix comment and counter in rb_yjit_invalidate_ep_is_bp()
Browse files Browse the repository at this point in the history
`mem::take` substitutes an empty instance which makes `jit.ep_is_bp()`
return false.
  • Loading branch information
XrXr committed May 3, 2024
1 parent 70db150 commit 03b7ffd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions yjit/src/invariants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
2 changes: 2 additions & 0 deletions yjit/src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 03b7ffd

Please sign in to comment.