Skip to content

Commit 778c1be

Browse files
sync sp of _DYNAMIC_EXIT
1 parent 77d5e1b commit 778c1be

5 files changed

Lines changed: 14 additions & 7 deletions

File tree

Include/internal/pycore_uop_metadata.h

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

Python/bytecodes.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5307,7 +5307,9 @@ dummy_func(
53075307
#endif
53085308
// Disabled for now (gh-139109) as it slows down dynamic code tremendously.
53095309
// Compile and jump to the cold dynamic executors in the future.
5310+
SYNC_SP();
53105311
GOTO_TIER_ONE(frame->instr_ptr);
5312+
Py_UNREACHABLE();
53115313
}
53125314

53135315
tier2 op(_CHECK_VALIDITY, (--)) {
@@ -5470,14 +5472,19 @@ dummy_func(
54705472
assert(tstate->jit_exit == exit);
54715473
exit->executor = executor;
54725474
TIER2_TO_TIER2(exit->executor);
5475+
Py_UNREACHABLE();
54735476
}
54745477
else {
54755478
if (frame->owner >= FRAME_OWNED_BY_INTERPRETER) {
5479+
SYNC_SP();
54765480
GOTO_TIER_ONE(target);
5481+
Py_UNREACHABLE();
54775482
}
54785483
if (!backoff_counter_triggers(temperature)) {
54795484
exit->temperature = advance_backoff_counter(temperature);
5485+
SYNC_SP();
54805486
GOTO_TIER_ONE(target);
5487+
Py_UNREACHABLE();
54815488
}
54825489
_PyExecutorObject *previous_executor = _PyExecutor_FromExit(exit);
54835490
assert(tstate->current_executor == (PyObject *)previous_executor);

Python/executor_cases.c.h

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

Python/jit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction trace[], siz
560560
unsigned char *code = memory;
561561
state.trampolines.mem = memory + code_size;
562562
unsigned char *data = memory + code_size + state.trampolines.size + code_padding;
563-
assert(trace[0].opcode == _START_EXECUTOR_r00 || trace[0].opcode == _COLD_EXIT_r00 || trace[0].opcode == _COLD_DYNAMIC_EXIT);
563+
assert(trace[0].opcode == _START_EXECUTOR_r00 || trace[0].opcode == _COLD_EXIT_r00 || trace[0].opcode == _COLD_DYNAMIC_EXIT_r00);
564564
for (size_t i = 0; i < length; i++) {
565565
const _PyUOpInstruction *instruction = &trace[i];
566566
group = &stencil_groups[instruction->opcode];

Python/optimizer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,14 +1655,14 @@ _PyExecutor_GetColdDynamicExecutor(void)
16551655
{
16561656
PyInterpreterState *interp = _PyInterpreterState_GET();
16571657
if (interp->cold_dynamic_executor != NULL) {
1658-
assert(interp->cold_dynamic_executor->trace[0].opcode == _COLD_DYNAMIC_EXIT);
1658+
assert(interp->cold_dynamic_executor->trace[0].opcode == _COLD_DYNAMIC_EXIT_r00);
16591659
return interp->cold_dynamic_executor;
16601660
}
16611661
_PyExecutorObject *cold = allocate_executor(0, 1);
16621662
if (cold == NULL) {
16631663
Py_FatalError("Cannot allocate core JIT code");
16641664
}
1665-
((_PyUOpInstruction *)cold->trace)->opcode = _COLD_DYNAMIC_EXIT;
1665+
((_PyUOpInstruction *)cold->trace)->opcode = _COLD_DYNAMIC_EXIT_r00;
16661666
#ifdef _Py_JIT
16671667
cold->jit_code = NULL;
16681668
cold->jit_size = 0;

0 commit comments

Comments
 (0)