Skip to content

Commit a9eac0f

Browse files
JIT: _EXIT_TRACE to ENTER_EXECUTOR rather than _DEOPT
1 parent f26ed45 commit a9eac0f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Include/internal/pycore_optimizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ PyAPI_FUNC(int) _PyDumpExecutors(FILE *out);
362362
extern void _Py_ClearExecutorDeletionList(PyInterpreterState *interp);
363363
#endif
364364

365-
int _PyJit_translate_single_bytecode_to_trace(PyThreadState *tstate, _PyInterpreterFrame *frame, _Py_CODEUNIT *next_instr, bool stop_tracing);
365+
int _PyJit_translate_single_bytecode_to_trace(PyThreadState *tstate, _PyInterpreterFrame *frame, _Py_CODEUNIT *next_instr, int stop_tracing_opcode);
366366

367367
int
368368
_PyJit_TryInitializeTracing(PyThreadState *tstate, _PyInterpreterFrame *frame,

Python/bytecodes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5644,7 +5644,7 @@ dummy_func(
56445644
bool stop_tracing = (opcode == WITH_EXCEPT_START ||
56455645
opcode == RERAISE || opcode == CLEANUP_THROW ||
56465646
opcode == PUSH_EXC_INFO || opcode == INTERPRETER_EXIT);
5647-
int full = !_PyJit_translate_single_bytecode_to_trace(tstate, frame, next_instr, stop_tracing);
5647+
int full = !_PyJit_translate_single_bytecode_to_trace(tstate, frame, next_instr, stop_tracing ? _DEOPT : 0);
56485648
if (full) {
56495649
LEAVE_TRACING();
56505650
int err = stop_tracing_and_jit(tstate, frame);
@@ -5684,7 +5684,7 @@ dummy_func(
56845684
#if _Py_TIER2
56855685
assert(IS_JIT_TRACING());
56865686
int opcode = next_instr->op.code;
5687-
_PyJit_translate_single_bytecode_to_trace(tstate, frame, NULL, true);
5687+
_PyJit_translate_single_bytecode_to_trace(tstate, frame, NULL, _EXIT_TRACE);
56885688
LEAVE_TRACING();
56895689
int err = stop_tracing_and_jit(tstate, frame);
56905690
ERROR_IF(err < 0);

Python/generated_cases.c.h

Lines changed: 2 additions & 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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ _PyJit_translate_single_bytecode_to_trace(
574574
PyThreadState *tstate,
575575
_PyInterpreterFrame *frame,
576576
_Py_CODEUNIT *next_instr,
577-
bool stop_tracing)
577+
int stop_tracing_opocde)
578578
{
579579

580580
#ifdef Py_DEBUG
@@ -637,8 +637,8 @@ _PyJit_translate_single_bytecode_to_trace(
637637
goto full;
638638
}
639639

640-
if (stop_tracing) {
641-
ADD_TO_TRACE(_DEOPT, 0, 0, target);
640+
if (stop_tracing_opocde != 0) {
641+
ADD_TO_TRACE(stop_tracing_opocde, 0, 0, target);
642642
goto done;
643643
}
644644

0 commit comments

Comments
 (0)