Skip to content

Commit 2e3ddc1

Browse files
Fix double-initialization
1 parent 92bba64 commit 2e3ddc1

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

Python/bytecodes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5490,8 +5490,8 @@ dummy_func(
54905490
}
54915491
_PyExecutorObject *previous_executor = _PyExecutor_FromExit(exit);
54925492
assert(tstate->current_executor == (PyObject *)previous_executor);
5493-
int chain_depth = previous_executor->vm_data.chain_depth + 1;
5494-
_PyJIT_InitializeTracing(tstate, frame, target, STACK_LEVEL(), chain_depth);
5493+
// Set chain_depth to 0 because we want to keep tracing whatever we see next.
5494+
_PyJIT_InitializeTracing(tstate, frame, target, STACK_LEVEL(), 0);
54955495
GOTO_TIER_ONE(target, 1);
54965496
}
54975497
exit->executor = executor;

Python/ceval_macros.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@ do { \
417417
if (keep_tracing_bit) { \
418418
assert(next_instr->op.code != ENTER_EXECUTOR); \
419419
ENTER_TRACING(); \
420-
_PyJIT_InitializeTracing(tstate, frame, next_instr, STACK_LEVEL(), 0); \
421420
} \
422421
else { \
423422
LEAVE_TRACING(); \

Python/executor_cases.c.h

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

Python/optimizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ _PyJIT_InitializeTracing(PyThreadState *tstate, _PyInterpreterFrame *frame, _Py_
805805
lltrace = *python_lltrace - '0'; // TODO: Parse an int and all that
806806
}
807807
DPRINTF(2,
808-
"Optimizing %s (%s:%d) at byte offset %d\n",
808+
"Tracing %s (%s:%d) at byte offset %d\n",
809809
PyUnicode_AsUTF8(code->co_qualname),
810810
PyUnicode_AsUTF8(code->co_filename),
811811
code->co_firstlineno,

0 commit comments

Comments
 (0)