Skip to content

Commit 0a67f82

Browse files
authored
[3.11] GH-93354: Fix PRECALL's adaptive backoff (GH-98011)
1 parent 450306e commit 0a67f82

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix an issue that could delay the specialization of :opcode:`PRECALL`
2+
instructions.

Diff for: Python/ceval.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -4793,7 +4793,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
47934793

47944794
TARGET(PRECALL_ADAPTIVE) {
47954795
_PyPrecallCache *cache = (_PyPrecallCache *)next_instr;
4796-
if (cache->counter == 0) {
4796+
if (ADAPTIVE_COUNTER_IS_ZERO(cache)) {
47974797
next_instr--;
47984798
int is_meth = is_method(stack_pointer, oparg);
47994799
int nargs = oparg + is_meth;
@@ -4807,7 +4807,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
48074807
}
48084808
else {
48094809
STAT_INC(PRECALL, deferred);
4810-
cache->counter--;
4810+
DECREMENT_ADAPTIVE_COUNTER(cache);
48114811
JUMP_TO_INSTRUCTION(PRECALL);
48124812
}
48134813
}

0 commit comments

Comments
 (0)