]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-115999: Record success in `specialize` (#127167)
authormpage <mpage@meta.com>
Fri, 22 Nov 2024 20:07:05 +0000 (12:07 -0800)
committerGitHub <noreply@github.com>
Fri, 22 Nov 2024 20:07:05 +0000 (12:07 -0800)
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

index 716d53a495c21b13d47557f9bbdedde847381e94..c1f4b0601cc8d559470b80d8bfb91a21c88ed74b 100644 (file)
@@ -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());
 }