mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
GH-108614: Remove TIER_ONE and TIER_TWO from _PUSH_FRAME (GH-108725)
This commit is contained in:
parent
074ac1f72e
commit
5a3672cb39
5 changed files with 47 additions and 40 deletions
40
Python/generated_cases.c.h
generated
40
Python/generated_cases.c.h
generated
|
|
@ -3843,6 +3843,7 @@
|
|||
PyFunctionObject *func = (PyFunctionObject *)callable;
|
||||
PyCodeObject *code = (PyCodeObject *)func->func_code;
|
||||
DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize), CALL);
|
||||
DEOPT_IF(tstate->py_recursion_remaining <= 1, CALL);
|
||||
}
|
||||
// _INIT_CALL_PY_EXACT_ARGS
|
||||
args = stack_pointer - oparg;
|
||||
|
|
@ -3878,18 +3879,19 @@
|
|||
// Eventually this should be the only occurrence of this code.
|
||||
frame->return_offset = 0;
|
||||
assert(tstate->interp->eval_frame == NULL);
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
STORE_SP();
|
||||
new_frame->previous = frame;
|
||||
CALL_STAT_INC(inlined_py_calls);
|
||||
frame = tstate->current_frame = new_frame;
|
||||
#if TIER_ONE
|
||||
goto start_frame;
|
||||
#endif
|
||||
#if TIER_TWO
|
||||
if (_Py_EnterRecursivePy(tstate)) goto pop_1_exit_unwind;
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
ip_offset = (_Py_CODEUNIT *)_PyFrame_GetCode(frame)->co_code_adaptive;
|
||||
#endif
|
||||
tstate->py_recursion_remaining--;
|
||||
LOAD_SP();
|
||||
LOAD_IP();
|
||||
#if LLTRACE && TIER_ONE
|
||||
lltrace = maybe_lltrace_resume_frame(frame, &entry_frame, GLOBALS());
|
||||
if (lltrace < 0) {
|
||||
goto exit_unwind;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
DISPATCH();
|
||||
}
|
||||
|
|
@ -3920,6 +3922,7 @@
|
|||
PyFunctionObject *func = (PyFunctionObject *)callable;
|
||||
PyCodeObject *code = (PyCodeObject *)func->func_code;
|
||||
DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize), CALL);
|
||||
DEOPT_IF(tstate->py_recursion_remaining <= 1, CALL);
|
||||
}
|
||||
// _INIT_CALL_PY_EXACT_ARGS
|
||||
args = stack_pointer - oparg;
|
||||
|
|
@ -3955,18 +3958,19 @@
|
|||
// Eventually this should be the only occurrence of this code.
|
||||
frame->return_offset = 0;
|
||||
assert(tstate->interp->eval_frame == NULL);
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
STORE_SP();
|
||||
new_frame->previous = frame;
|
||||
CALL_STAT_INC(inlined_py_calls);
|
||||
frame = tstate->current_frame = new_frame;
|
||||
#if TIER_ONE
|
||||
goto start_frame;
|
||||
#endif
|
||||
#if TIER_TWO
|
||||
if (_Py_EnterRecursivePy(tstate)) goto pop_1_exit_unwind;
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
ip_offset = (_Py_CODEUNIT *)_PyFrame_GetCode(frame)->co_code_adaptive;
|
||||
#endif
|
||||
tstate->py_recursion_remaining--;
|
||||
LOAD_SP();
|
||||
LOAD_IP();
|
||||
#if LLTRACE && TIER_ONE
|
||||
lltrace = maybe_lltrace_resume_frame(frame, &entry_frame, GLOBALS());
|
||||
if (lltrace < 0) {
|
||||
goto exit_unwind;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
DISPATCH();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue