mirror of
https://github.com/python/cpython.git
synced 2025-10-19 16:03:42 +00:00
gh-133171: Re-enable JUMP_BACKWARD to free-threading build (gh-137800)
This commit is contained in:
parent
c8624cd367
commit
c4f21d7c7c
7 changed files with 47 additions and 34 deletions
|
@ -2940,9 +2940,10 @@ dummy_func(
|
|||
};
|
||||
|
||||
tier1 op(_SPECIALIZE_JUMP_BACKWARD, (--)) {
|
||||
#if ENABLE_SPECIALIZATION
|
||||
#if ENABLE_SPECIALIZATION_FT
|
||||
if (this_instr->op.code == JUMP_BACKWARD) {
|
||||
this_instr->op.code = tstate->interp->jit ? JUMP_BACKWARD_JIT : JUMP_BACKWARD_NO_JIT;
|
||||
uint8_t desired = tstate->interp->jit ? JUMP_BACKWARD_JIT : JUMP_BACKWARD_NO_JIT;
|
||||
FT_ATOMIC_STORE_UINT8_RELAXED(this_instr->op.code, desired);
|
||||
// Need to re-dispatch so the warmup counter isn't off by one:
|
||||
next_instr = this_instr;
|
||||
DISPATCH_SAME_OPARG();
|
||||
|
|
5
Python/generated_cases.c.h
generated
5
Python/generated_cases.c.h
generated
|
@ -7589,9 +7589,10 @@
|
|||
/* Skip 1 cache entry */
|
||||
// _SPECIALIZE_JUMP_BACKWARD
|
||||
{
|
||||
#if ENABLE_SPECIALIZATION
|
||||
#if ENABLE_SPECIALIZATION_FT
|
||||
if (this_instr->op.code == JUMP_BACKWARD) {
|
||||
this_instr->op.code = tstate->interp->jit ? JUMP_BACKWARD_JIT : JUMP_BACKWARD_NO_JIT;
|
||||
uint8_t desired = tstate->interp->jit ? JUMP_BACKWARD_JIT : JUMP_BACKWARD_NO_JIT;
|
||||
FT_ATOMIC_STORE_UINT8_RELAXED(this_instr->op.code, desired);
|
||||
next_instr = this_instr;
|
||||
DISPATCH_SAME_OPARG();
|
||||
}
|
||||
|
|
|
@ -119,6 +119,7 @@ _PyOptimizer_Optimize(
|
|||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
assert(interp->jit);
|
||||
assert(!interp->compiling);
|
||||
#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
|
||||
|
@ -160,6 +161,9 @@ _PyOptimizer_Optimize(
|
|||
assert((*executor_ptr)->vm_data.valid);
|
||||
interp->compiling = false;
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static _PyExecutorObject *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue