[3.11] GH-93354: Fix PRECALL's adaptive backoff (GH-98011)

This commit is contained in:
Brandt Bucher 2022-10-12 16:04:47 -07:00 committed by GitHub
parent 450306ed67
commit 0a67f82eb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -4793,7 +4793,7 @@ handle_eval_breaker:
TARGET(PRECALL_ADAPTIVE) {
_PyPrecallCache *cache = (_PyPrecallCache *)next_instr;
if (cache->counter == 0) {
if (ADAPTIVE_COUNTER_IS_ZERO(cache)) {
next_instr--;
int is_meth = is_method(stack_pointer, oparg);
int nargs = oparg + is_meth;
@ -4807,7 +4807,7 @@ handle_eval_breaker:
}
else {
STAT_INC(PRECALL, deferred);
cache->counter--;
DECREMENT_ADAPTIVE_COUNTER(cache);
JUMP_TO_INSTRUCTION(PRECALL);
}
}