gh-143604: Hold strong reference to executor during JIT tracing (GH-143646)

Co-authored-by: Ken Jin <kenjin4096@gmail.com>
This commit is contained in:
Nadeshiko Manju 2026-01-10 19:15:48 +08:00 committed by GitHub
parent e7f5ffa0de
commit e2f0160026
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 41 additions and 8 deletions

View file

@ -2990,7 +2990,7 @@ dummy_func(
oparg >>= 8;
insert_exec_at--;
}
int succ = _PyJit_TryInitializeTracing(tstate, frame, this_instr, insert_exec_at, next_instr, STACK_LEVEL(), 0, NULL, oparg);
int succ = _PyJit_TryInitializeTracing(tstate, frame, this_instr, insert_exec_at, next_instr, STACK_LEVEL(), 0, NULL, oparg, NULL);
if (succ) {
ENTER_TRACING();
}
@ -5525,7 +5525,7 @@ dummy_func(
// Note: it's safe to use target->op.arg here instead of the oparg given by EXTENDED_ARG.
// The invariant in the optimizer is the deopt target always points back to the first EXTENDED_ARG.
// So setting it to anything else is wrong.
int succ = _PyJit_TryInitializeTracing(tstate, frame, target, target, target, STACK_LEVEL(), chain_depth, exit, target->op.arg);
int succ = _PyJit_TryInitializeTracing(tstate, frame, target, target, target, STACK_LEVEL(), chain_depth, exit, target->op.arg, previous_executor);
exit->temperature = restart_backoff_counter(exit->temperature);
if (succ) {
GOTO_TIER_ONE_CONTINUE_TRACING(target);