mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-139109: JIT _EXIT_TRACE to ENTER_EXECUTOR rather than _DEOPT (GH-141573)
This commit is contained in:
parent
85f3009d75
commit
ed73c909f2
5 changed files with 44 additions and 8 deletions
|
|
@ -5643,7 +5643,7 @@ dummy_func(
|
|||
bool stop_tracing = (opcode == WITH_EXCEPT_START ||
|
||||
opcode == RERAISE || opcode == CLEANUP_THROW ||
|
||||
opcode == PUSH_EXC_INFO || opcode == INTERPRETER_EXIT);
|
||||
int full = !_PyJit_translate_single_bytecode_to_trace(tstate, frame, next_instr, stop_tracing);
|
||||
int full = !_PyJit_translate_single_bytecode_to_trace(tstate, frame, next_instr, stop_tracing ? _DEOPT : 0);
|
||||
if (full) {
|
||||
LEAVE_TRACING();
|
||||
int err = stop_tracing_and_jit(tstate, frame);
|
||||
|
|
@ -5683,7 +5683,7 @@ dummy_func(
|
|||
#if _Py_TIER2
|
||||
assert(IS_JIT_TRACING());
|
||||
int opcode = next_instr->op.code;
|
||||
_PyJit_translate_single_bytecode_to_trace(tstate, frame, NULL, true);
|
||||
_PyJit_translate_single_bytecode_to_trace(tstate, frame, NULL, _EXIT_TRACE);
|
||||
LEAVE_TRACING();
|
||||
int err = stop_tracing_and_jit(tstate, frame);
|
||||
ERROR_IF(err < 0);
|
||||
|
|
|
|||
4
Python/generated_cases.c.h
generated
4
Python/generated_cases.c.h
generated
|
|
@ -12263,7 +12263,7 @@ JUMP_TO_LABEL(error);
|
|||
opcode == RERAISE || opcode == CLEANUP_THROW ||
|
||||
opcode == PUSH_EXC_INFO || opcode == INTERPRETER_EXIT);
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
int full = !_PyJit_translate_single_bytecode_to_trace(tstate, frame, next_instr, stop_tracing);
|
||||
int full = !_PyJit_translate_single_bytecode_to_trace(tstate, frame, next_instr, stop_tracing ? _DEOPT : 0);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
if (full) {
|
||||
LEAVE_TRACING();
|
||||
|
|
@ -12309,7 +12309,7 @@ JUMP_TO_LABEL(error);
|
|||
assert(IS_JIT_TRACING());
|
||||
int opcode = next_instr->op.code;
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
_PyJit_translate_single_bytecode_to_trace(tstate, frame, NULL, true);
|
||||
_PyJit_translate_single_bytecode_to_trace(tstate, frame, NULL, _EXIT_TRACE);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
LEAVE_TRACING();
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
|
|
|
|||
|
|
@ -574,7 +574,7 @@ _PyJit_translate_single_bytecode_to_trace(
|
|||
PyThreadState *tstate,
|
||||
_PyInterpreterFrame *frame,
|
||||
_Py_CODEUNIT *next_instr,
|
||||
bool stop_tracing)
|
||||
int stop_tracing_opcode)
|
||||
{
|
||||
|
||||
#ifdef Py_DEBUG
|
||||
|
|
@ -637,8 +637,8 @@ _PyJit_translate_single_bytecode_to_trace(
|
|||
goto full;
|
||||
}
|
||||
|
||||
if (stop_tracing) {
|
||||
ADD_TO_TRACE(_DEOPT, 0, 0, target);
|
||||
if (stop_tracing_opcode != 0) {
|
||||
ADD_TO_TRACE(stop_tracing_opcode, 0, 0, target);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue