mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
GH-129715: Remove _DYNAMIC_EXIT (GH-129716)
This commit is contained in:
parent
e4a00f70b1
commit
5fa7e1b7fd
13 changed files with 138 additions and 226 deletions
|
@ -5117,42 +5117,6 @@ dummy_func(
|
|||
DECREF_INPUTS();
|
||||
}
|
||||
|
||||
tier2 op(_DYNAMIC_EXIT, (exit_p/4 --)) {
|
||||
tstate->previous_executor = (PyObject *)current_executor;
|
||||
_PyExitData *exit = (_PyExitData *)exit_p;
|
||||
_Py_CODEUNIT *target = frame->instr_ptr;
|
||||
#if defined(Py_DEBUG) && !defined(_Py_JIT)
|
||||
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
|
||||
if (frame->lltrace >= 2) {
|
||||
printf("DYNAMIC EXIT: [UOp ");
|
||||
_PyUOpPrint(&next_uop[-1]);
|
||||
printf(", exit %lu, temp %d, target %d -> %s]\n",
|
||||
exit - current_executor->exits, exit->temperature.value_and_backoff,
|
||||
(int)(target - _PyFrame_GetBytecode(frame)),
|
||||
_PyOpcode_OpName[target->op.code]);
|
||||
}
|
||||
#endif
|
||||
_PyExecutorObject *executor;
|
||||
if (target->op.code == ENTER_EXECUTOR) {
|
||||
PyCodeObject *code = _PyFrame_GetCode(frame);
|
||||
executor = code->co_executors->executors[target->op.arg];
|
||||
Py_INCREF(executor);
|
||||
}
|
||||
else {
|
||||
if (!backoff_counter_triggers(exit->temperature)) {
|
||||
exit->temperature = advance_backoff_counter(exit->temperature);
|
||||
GOTO_TIER_ONE(target);
|
||||
}
|
||||
int optimized = _PyOptimizer_Optimize(frame, target, &executor, 0);
|
||||
if (optimized <= 0) {
|
||||
exit->temperature = restart_backoff_counter(exit->temperature);
|
||||
GOTO_TIER_ONE(optimized < 0 ? NULL : target);
|
||||
}
|
||||
exit->temperature = initial_temperature_backoff_counter();
|
||||
}
|
||||
GOTO_TIER_TWO(executor);
|
||||
}
|
||||
|
||||
tier2 op(_START_EXECUTOR, (executor/4 --)) {
|
||||
Py_CLEAR(tstate->previous_executor);
|
||||
#ifndef _Py_JIT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue