]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fix backoff counters
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Tue, 28 Oct 2025 00:12:59 +0000 (00:12 +0000)
committerKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Tue, 28 Oct 2025 00:12:59 +0000 (00:12 +0000)
Python/bytecodes.c
Python/generated_cases.c.h

index b3977e5613b4dc88004c2a9a4dc61ab4545bf619..96772a772f242f9f07e9fe5e642b357f30e179f6 100644 (file)
@@ -2956,6 +2956,7 @@ dummy_func(
             if (!IS_JIT_TRACING() && backoff_counter_triggers(counter) &&
                 this_instr->op.code == JUMP_BACKWARD_JIT &&
                 next_instr->op.code != ENTER_EXECUTOR) {
+                this_instr[1].counter = restart_backoff_counter(counter);
                 if (tstate->interp->jit_state.code_buffer == NULL) {
                     tstate->interp->jit_state.code_buffer = (_PyUOpInstruction *)_PyObject_VirtualAlloc(UOP_BUFFER_SIZE);
                     if (tstate->interp->jit_state.code_buffer == NULL) {
index b97f4987c80fddf461c5e74596ff68f8ad40212f..7daab9556e74bdd0d9d81c61a3b67f498cb23fd4 100644 (file)
                 if (!IS_JIT_TRACING() && backoff_counter_triggers(counter) &&
                     this_instr->op.code == JUMP_BACKWARD_JIT &&
                     next_instr->op.code != ENTER_EXECUTOR) {
+                    this_instr[1].counter = restart_backoff_counter(counter);
                     if (tstate->interp->jit_state.code_buffer == NULL) {
                         _PyFrame_SetStackPointer(frame, stack_pointer);
                         tstate->interp->jit_state.code_buffer = (_PyUOpInstruction *)_PyObject_VirtualAlloc(UOP_BUFFER_SIZE);