Skip to content

Commit 5a3672c

Browse files
authored
GH-108614: Remove TIER_ONE and TIER_TWO from _PUSH_FRAME (GH-108725)
1 parent 074ac1f commit 5a3672c

File tree

5 files changed

+47
-40
lines changed

5 files changed

+47
-40
lines changed

Include/internal/pycore_opcode_metadata.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/bytecodes.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2974,6 +2974,7 @@ dummy_func(
29742974
PyFunctionObject *func = (PyFunctionObject *)callable;
29752975
PyCodeObject *code = (PyCodeObject *)func->func_code;
29762976
DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize), CALL);
2977+
DEOPT_IF(tstate->py_recursion_remaining <= 1, CALL);
29772978
}
29782979

29792980
op(_INIT_CALL_PY_EXACT_ARGS, (callable, self_or_null, args[oparg] -- new_frame: _PyInterpreterFrame*)) {
@@ -2998,18 +2999,19 @@ dummy_func(
29982999
// Eventually this should be the only occurrence of this code.
29993000
frame->return_offset = 0;
30003001
assert(tstate->interp->eval_frame == NULL);
3001-
_PyFrame_SetStackPointer(frame, stack_pointer);
3002+
STORE_SP();
30023003
new_frame->previous = frame;
30033004
CALL_STAT_INC(inlined_py_calls);
30043005
frame = tstate->current_frame = new_frame;
3005-
#if TIER_ONE
3006-
goto start_frame;
3007-
#endif
3008-
#if TIER_TWO
3009-
ERROR_IF(_Py_EnterRecursivePy(tstate), exit_unwind);
3010-
stack_pointer = _PyFrame_GetStackPointer(frame);
3011-
ip_offset = (_Py_CODEUNIT *)_PyFrame_GetCode(frame)->co_code_adaptive;
3012-
#endif
3006+
tstate->py_recursion_remaining--;
3007+
LOAD_SP();
3008+
LOAD_IP();
3009+
#if LLTRACE && TIER_ONE
3010+
lltrace = maybe_lltrace_resume_frame(frame, &entry_frame, GLOBALS());
3011+
if (lltrace < 0) {
3012+
goto exit_unwind;
3013+
}
3014+
#endif
30133015
}
30143016

30153017
macro(CALL_BOUND_METHOD_EXACT_ARGS) =

Python/executor.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ _PyUopExecute(_PyExecutorObject *executor, _PyInterpreterFrame *frame, PyObject
109109
pop_2_error:
110110
STACK_SHRINK(1);
111111
pop_1_error:
112-
pop_1_exit_unwind:
113112
STACK_SHRINK(1);
114113
error:
115114
// On ERROR_IF we return NULL as the frame.

Python/executor_cases.c.h

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

Python/generated_cases.c.h

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

0 commit comments

Comments
 (0)