From ee3e7721d1eb99caf9196d92d6700ad9636e957e Mon Sep 17 00:00:00 2001 From: Matt Page Date: Fri, 22 Nov 2024 09:32:55 -0800 Subject: [PATCH] Record success in `specialize` This matches the existing behavior where we increment the success stat for the generic opcode each time we successfully specialize an instruction. --- Python/specialize.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/specialize.c b/Python/specialize.c index 716d53a495c21b..c1f4b0601cc8d5 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -715,6 +715,7 @@ specialize(_Py_CODEUNIT *instr, uint8_t specialized_opcode) SPEC_FAIL_OTHER); return; } + STAT_INC(_PyOpcode_Deopt[specialized_opcode], success); set_counter((_Py_BackoffCounter *)instr + 1, adaptive_counter_cooldown()); }