]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix progress needed and warmup
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Tue, 23 Sep 2025 23:08:33 +0000 (00:08 +0100)
committerKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Tue, 23 Sep 2025 23:08:33 +0000 (00:08 +0100)
Python/bytecodes.c
Python/executor_cases.c.h
Python/generated_cases.c.h
Python/optimizer.c

index d033900c30839d546c34ebc4c4fdc7d4102851a6..658177c041dc6ea3678950e884c048f78db3d0d6 100644 (file)
@@ -3047,13 +3047,7 @@ dummy_func(
             assert(executor != tstate->interp->cold_executor);
             tstate->jit_exit = NULL;
             if (IS_JIT_TRACING()) {
-                int old_opcode = executor->vm_data.opcode;
-                int old_oparg = (oparg & ~255) | executor->vm_data.oparg;
                 RECORD_TRACE_NO_DISPATCH();
-                opcode = old_opcode;
-                oparg = old_oparg;
-                next_instr = this_instr;
-                DISPATCH_GOTO();
             }
             TIER1_TO_TIER2(executor);
             #else
@@ -5453,6 +5447,7 @@ dummy_func(
                     exit->temperature = advance_backoff_counter(temperature);
                     GOTO_TIER_ONE(target, 0);
                 }
+                exit->temperature = initial_temperature_backoff_counter();
                 _PyExecutorObject *previous_executor = _PyExecutor_FromExit(exit);
                 assert(tstate->current_executor == (PyObject *)previous_executor);
                 int chain_depth = is_dynamic ? 0 : current_executor->vm_data.chain_depth + 1;
index d4c7c6ad5687a3f35375e1ba4daa710d356bd338..b25fb61bd5209dbd2cc2a5d6a0ce1ea2fd68469c 100644 (file)
                     exit->temperature = advance_backoff_counter(temperature);
                     GOTO_TIER_ONE(target, 0);
                 }
+                exit->temperature = initial_temperature_backoff_counter();
                 _PyExecutorObject *previous_executor = _PyExecutor_FromExit(exit);
                 assert(tstate->current_executor == (PyObject *)previous_executor);
                 int chain_depth = is_dynamic ? 0 : current_executor->vm_data.chain_depth + 1;
index 229d75a8dc0dc7e96ec37631a333eed22381442d..70e3b79856392072bd3b2082d16a8a9474b7d03f 100644 (file)
             assert(executor != tstate->interp->cold_executor);
             tstate->jit_exit = NULL;
             if (IS_JIT_TRACING()) {
-                int old_opcode = executor->vm_data.opcode;
-                int old_oparg = (oparg & ~255) | executor->vm_data.oparg;
                 RECORD_TRACE_NO_DISPATCH();
-                opcode = old_opcode;
-                oparg = old_oparg;
-                next_instr = this_instr;
-                DISPATCH_GOTO();
             }
             TIER1_TO_TIER2(executor);
             #else
             assert(executor != tstate->interp->cold_executor);
             tstate->jit_exit = NULL;
             if (IS_JIT_TRACING()) {
-                int old_opcode = executor->vm_data.opcode;
-                int old_oparg = (oparg & ~255) | executor->vm_data.oparg;
                 RECORD_TRACE_NO_DISPATCH();
-                opcode = old_opcode;
-                oparg = old_oparg;
-                next_instr = this_instr;
-                DISPATCH_GOTO();
             }
             TIER1_TO_TIER2(executor);
             #else
index 8c7028b2a5a399aa4364e40eb4ad76b47d5a0e7d..1afbadc207d59216ff0623a3df8cbb844841746a 100644 (file)
@@ -638,7 +638,7 @@ _PyJIT_translate_single_bytecode_to_trace(
 
     /* Special case the first instruction,
      * so that we can guarantee forward progress */
-    if (progress_needed && is_first_instr && tstate->interp->jit_tracer_code_curr_size == 0) {
+    if (progress_needed && is_first_instr) {
         if (OPCODE_HAS_EXIT(opcode) || OPCODE_HAS_DEOPT(opcode)) {
             opcode = _PyOpcode_Deopt[opcode];
         }