summaryrefslogtreecommitdiff
path: root/yjit
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2025-03-07 17:42:03 -0500
committerAlan Wu <[email protected]>2025-03-07 20:23:32 -0500
commit98790faae3cbbe67a5335df30f6e9000f3a83ad9 ()
treeab37c388d437f15cefe8d7aa05925de26637883f /yjit
parent3c92fe13f83c458991349a9b77963c90027fe53b (diff)
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.
Notes: Merged: https://.com/ruby/ruby/pull/12882
-rw-r--r--yjit/src/invariants.rs2
-rw-r--r--yjit/src/stats.rs2
2 files changed, 4 insertions, 0 deletions
@@ -626,6 +626,8 @@ pub extern "C" fn rb_yjit_tracing_invalidate_all() {
return;
}
// Stop other ractors since we are going to machine code.
with_vm_lock(src_loc!(), || {
// Make it so all live block versions are no longer valid branch targets
@@ -293,6 +293,7 @@ pub const DEFAULT_COUNTERS: &'static [Counter] = &[
Counter::invalidate_constant_ic_fill,
Counter::invalidate_no_singleton_class,
Counter::invalidate_ep_escape,
];
/// Macro to increase a counter by name and count
@@ -589,6 +590,7 @@ make_counters! {
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.