From c1dde6d3877ad6f08879627689f4eb61d2eed478 Mon Sep 17 00:00:00 2001 From: Max Bernstein Date: Thu, 22 Jan 2026 17:53:28 -0500 Subject: [PATCH] ZJIT: Count GuardBitEquals for shapes as GuardShape in stats (#15936) This brings back the GuardShape exit ratio in stats. --- zjit/src/codegen.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zjit/src/codegen.rs b/zjit/src/codegen.rs index 1729d44041..8714518866 100644 --- a/zjit/src/codegen.rs +++ b/zjit/src/codegen.rs @@ -2276,6 +2276,9 @@ fn gen_guard_type_not(jit: &mut JITState, asm: &mut Assembler, val: lir::Opnd, g /// Compile an identity check with a side exit fn gen_guard_bit_equals(jit: &mut JITState, asm: &mut Assembler, val: lir::Opnd, expected: crate::hir::Const, reason: SideExitReason, state: &FrameState) -> lir::Opnd { + if matches!(reason, SideExitReason::GuardShape(_) ) { + gen_incr_counter(asm, Counter::guard_shape_count); + } let expected_opnd: Opnd = match expected { crate::hir::Const::Value(v) => { Opnd::Value(v) } crate::hir::Const::CInt64(v) => { v.into() }