From b3710fa4b9aaf2f3bceaa1a4e3a2d1ec18cbea90 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Thu, 6 Oct 2022 05:39:23 -0700 Subject: [PATCH 1/2] Fix PRECALL's adaptive backoff --- Python/ceval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Python/ceval.c b/Python/ceval.c index c5283ace43cfb1..c0d9c68de04b0c 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4793,7 +4793,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int 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 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int } else { STAT_INC(PRECALL, deferred); - cache->counter--; + DECREMENT_ADAPTIVE_COUNTER(cache); JUMP_TO_INSTRUCTION(PRECALL); } } From ab54887ab50713d7b7bcf55d06335b1ed6be2598 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Thu, 6 Oct 2022 05:41:09 -0700 Subject: [PATCH 2/2] blurb add --- .../2022-10-06-05-41-01.gh-issue-93354.6BpHl2.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2022-10-06-05-41-01.gh-issue-93354.6BpHl2.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-10-06-05-41-01.gh-issue-93354.6BpHl2.rst b/Misc/NEWS.d/next/Core and Builtins/2022-10-06-05-41-01.gh-issue-93354.6BpHl2.rst new file mode 100644 index 00000000000000..4efc10da293a03 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2022-10-06-05-41-01.gh-issue-93354.6BpHl2.rst @@ -0,0 +1,2 @@ +Fix an issue that could delay the specialization of :opcode:`PRECALL` +instructions.