Skip to content

Commit a64215d

Browse files
Remove _DYNAMIC_EXIT jumping for now.
1 parent bf1ddab commit a64215d

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

Python/bytecodes.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5289,8 +5289,8 @@ dummy_func(
52895289
// Note: this is different than _COLD_EXIT/_EXIT_TRACE, as it may lead to multiple executors
52905290
// from a single exit!
52915291
tier2 op(_DYNAMIC_EXIT, (exit_p/4 --)) {
5292-
_PyExitData *exit = (_PyExitData *)exit_p;
52935292
#if defined(Py_DEBUG) && !defined(_Py_JIT)
5293+
_PyExitData *exit = (_PyExitData *)exit_p;
52945294
_Py_CODEUNIT *target = frame->instr_ptr;
52955295
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
52965296
if (frame->lltrace >= 2) {
@@ -5302,10 +5302,9 @@ dummy_func(
53025302
_PyOpcode_OpName[target->op.code]);
53035303
}
53045304
#endif
5305-
tstate->jit_exit = exit;
5306-
_PyExecutorObject *exec = exit->executor;
5307-
assert(exec->trace[0].opcode == _COLD_DYNAMIC_EXIT);
5308-
TIER2_TO_TIER2(exec);
5305+
// Disabled for now (gh-139109) as it slows down dynamic code tremendously.
5306+
// Compile and jump to the cold dynamic executors in the future.
5307+
GOTO_TIER_ONE(frame->instr_ptr);
53095308
}
53105309

53115310
tier2 op(_DYNAMIC_DEOPT, (--)) {
@@ -5475,6 +5474,9 @@ dummy_func(
54755474
PyCodeObject *code = _PyFrame_GetCode(frame);
54765475
executor = code->co_executors->executors[target->op.arg];
54775476
Py_INCREF(executor);
5477+
assert(tstate->jit_exit == exit);
5478+
exit->executor = executor;
5479+
TIER2_TO_TIER2(exit->executor);
54785480
}
54795481
else {
54805482
if (frame->owner >= FRAME_OWNED_BY_INTERPRETER) {
@@ -5499,14 +5501,9 @@ dummy_func(
54995501
}
55005502
GOTO_TIER_ONE(target);
55015503
}
5502-
assert(tstate->jit_exit == exit);
5503-
exit->executor = executor;
5504-
TIER2_TO_TIER2(exit->executor);
55055504
}
55065505

55075506
tier2 op(_COLD_DYNAMIC_EXIT, ( -- )) {
5508-
_PyExitData *exit = tstate->jit_exit;
5509-
assert(exit != NULL);
55105507
_Py_CODEUNIT *target = frame->instr_ptr;
55115508
GOTO_TIER_ONE(target);
55125509
}

Python/executor_cases.c.h

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

0 commit comments

Comments
 (0)