]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merge remote-tracking branch 'upstream/main' into tracing_jit
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Sat, 18 Oct 2025 22:01:47 +0000 (23:01 +0100)
committerKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Sat, 18 Oct 2025 22:01:47 +0000 (23:01 +0100)
12 files changed:
1  2 
Include/internal/pycore_interp_structs.h
Lib/test/test_capi/test_opt.py
Makefile.pre.in
Modules/_testinternalcapi.c
Objects/funcobject.c
Python/bytecodes.c
Python/ceval.c
Python/generated_cases.c.h
Python/optimizer.c
Python/optimizer_symbols.c
Python/pystate.c
Tools/c-analyzer/cpython/_parser.py

Simple merge
diff --cc Makefile.pre.in
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc Python/ceval.c
Simple merge
Simple merge
index 824f67d0a126ed9d541ed6fcbbab879234d47c47,6ad9124744859a3dd75a88f61d8d23c00fc2b2e0..a6d9c7904ee6380eb90390a4f31897c2946ae8a9
@@@ -115,13 -112,14 +115,14 @@@ uop_optimize(_PyInterpreterFrame *frame
  // gh-137573: inlining this function causes stack overflows
  Py_NO_INLINE int
  _PyOptimizer_Optimize(
 -    _PyInterpreterFrame *frame, _Py_CODEUNIT *start,
 -    _PyExecutorObject **executor_ptr, int chain_depth)
 +    _PyInterpreterFrame *frame, PyThreadState *tstate)
  {
 -    _PyStackRef *stack_pointer = frame->stackpointer;
      PyInterpreterState *interp = _PyInterpreterState_GET();
 +    int chain_depth = tstate->interp->jit_state.jit_tracer_initial_chain_depth;
      assert(interp->jit);
      assert(!interp->compiling);
 +    assert(tstate->interp->jit_state.jit_tracer_initial_stack_depth >= 0);
+ #ifndef Py_GIL_DISABLED
      interp->compiling = true;
      // The first executor in a chain and the MAX_CHAIN_DEPTH'th executor *must*
      // make progress in order to avoid infinite loops or excessively-long
              interp->compiling = false;
              return 0;
          }
 -        insert_executor(code, start, index, *executor_ptr);
 +        insert_executor(code, start, index, executor);
      }
      else {
 -        (*executor_ptr)->vm_data.code = NULL;
 +        executor->vm_data.code = NULL;
 +    }
 +    if (chain_depth > 0) {
 +        _PyExitData *prev_exit = tstate->interp->jit_state.jit_tracer_previous_exit;
 +        assert(prev_exit != NULL);
 +        prev_exit->executor = executor;;
      }
 -    (*executor_ptr)->vm_data.chain_depth = chain_depth;
 -    assert((*executor_ptr)->vm_data.valid);
 +    executor->vm_data.chain_depth = chain_depth;
 +    assert(executor->vm_data.valid);
      interp->compiling = false;
      return 1;
+ #else
+     return 0;
+ #endif
  }
  
  static _PyExecutorObject *
Simple merge
Simple merge
Simple merge