Skip to content

Commit 6bd1541

Browse files
Fix FT
1 parent 8aeabd5 commit 6bd1541

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

Python/bytecodes.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5229,7 +5229,7 @@ dummy_func(
52295229
ERROR_IF(err < 0);
52305230
DISPATCH_GOTO_NON_TRACING();
52315231
}
5232-
// Super instructions. Instruction deopted, There's a mismatch in what the stack expects
5232+
// Super instructions. Instruction deopted. There's a mismatch in what the stack expects
52335233
// in the optimizer. So we have to reflect in the trace correctly.
52345234
if ((tstate->interp->jit_state.prev_instr->op.code == CALL_LIST_APPEND &&
52355235
opcode == POP_TOP) ||
@@ -5470,17 +5470,17 @@ dummy_func(
54705470
assert(exit != NULL);
54715471
_Py_CODEUNIT *target = _PyFrame_GetBytecode(frame) + exit->target;
54725472
_Py_BackoffCounter temperature = exit->temperature;
5473-
if (!backoff_counter_triggers(temperature)) {
5474-
exit->temperature = advance_backoff_counter(temperature);
5475-
GOTO_TIER_ONE(target);
5476-
}
54775473
_PyExecutorObject *executor;
54785474
if (target->op.code == ENTER_EXECUTOR) {
54795475
PyCodeObject *code = _PyFrame_GetCode(frame);
54805476
executor = code->co_executors->executors[target->op.arg];
54815477
Py_INCREF(executor);
54825478
}
54835479
else {
5480+
if (!backoff_counter_triggers(temperature)) {
5481+
exit->temperature = advance_backoff_counter(temperature);
5482+
GOTO_TIER_ONE(target);
5483+
}
54845484
_PyExecutorObject *previous_executor = _PyExecutor_FromExit(exit);
54855485
assert(tstate->current_executor == (PyObject *)previous_executor);
54865486
int chain_depth = previous_executor->vm_data.chain_depth + 1;

Python/ceval_macros.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,11 @@ GETITEM(PyObject *v, Py_ssize_t i) {
355355
#define RECORD_BRANCH_TAKEN(bitset, flag)
356356
#endif
357357

358-
#define RECORD_DYNAMIC_JUMP_TAKEN() tstate->interp->jit_state.dynamic_jump_taken = true;
358+
#if _Py_TIER2
359+
# define RECORD_DYNAMIC_JUMP_TAKEN() tstate->interp->jit_state.dynamic_jump_taken = true;
360+
#else
361+
# define RECORD_DYNAMIC_JUMP_TAKEN()
362+
#endif
359363

360364
#define UNBOUNDLOCAL_ERROR_MSG \
361365
"cannot access local variable '%s' where it is not associated with a value"

Python/executor_cases.c.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)