Skip to content

Commit f906c97

Browse files
Add start_frame label
1 parent 1463132 commit f906c97

File tree

5 files changed

+509
-21
lines changed

5 files changed

+509
-21
lines changed

Python/bytecodes.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5194,6 +5194,28 @@ dummy_func(
51945194
assert(tstate->tracing || eval_breaker == FT_ATOMIC_LOAD_UINTPTR_ACQUIRE(_PyFrame_GetCode(frame)->_co_instrumentation_version));
51955195
}
51965196

5197+
label(start_frame) {
5198+
if (_Py_EnterRecursivePy(tstate)) {
5199+
goto exit_unwind;
5200+
}
5201+
5202+
next_instr = frame->instr_ptr;
5203+
stack_pointer = _PyFrame_GetStackPointer(frame);
5204+
5205+
#ifdef Py_DEBUG
5206+
int lltrace = maybe_lltrace_resume_frame(frame, GLOBALS());
5207+
frame->lltrace = lltrace;
5208+
if (lltrace < 0) {
5209+
goto exit_unwind;
5210+
}
5211+
#endif
5212+
#if defined(Py_TAIL_CALL_INTERP) && !defined(IN_TAIL_CALL_INTERP)
5213+
return _TAIL_CALL_shim(frame, stack_pointer, tstate, next_instr, 0, 0);
5214+
#else
5215+
DISPATCH();
5216+
#endif
5217+
}
5218+
51975219
label(pop_4_error) {
51985220
STACK_SHRINK(1);
51995221
goto pop_3_error;

Python/ceval.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,13 +866,11 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
866866
const _PyUOpInstruction *next_uop = NULL;
867867
#endif
868868

869-
start_frame:
870869
if (_Py_EnterRecursivePy(tstate)) {
871870
goto exit_unwind;
872871
}
873872

874873
next_instr = frame->instr_ptr;
875-
resume_frame:
876874
stack_pointer = _PyFrame_GetStackPointer(frame);
877875

878876
LLTRACE_RESUME_FRAME();

Python/ceval_macros.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -140,24 +140,6 @@ do { \
140140
DISPATCH_GOTO(); \
141141
}
142142

143-
#ifdef Py_TAIL_CALL_INTERP
144-
#define DISPATCH_INLINED(NEW_FRAME) \
145-
do { \
146-
assert(tstate->interp->eval_frame == NULL); \
147-
_PyFrame_SetStackPointer(frame, stack_pointer); \
148-
assert((NEW_FRAME)->previous == frame); \
149-
frame = tstate->current_frame = (NEW_FRAME); \
150-
CALL_STAT_INC(inlined_py_calls); \
151-
if (_Py_EnterRecursivePy(tstate)) {\
152-
goto exit_unwind;\
153-
} \
154-
next_instr = frame->instr_ptr; \
155-
stack_pointer = _PyFrame_GetStackPointer(frame); \
156-
LLTRACE_RESUME_FRAME(); \
157-
NEXTOPARG(); \
158-
DISPATCH_GOTO(); \
159-
} while (0)
160-
#else
161143
#define DISPATCH_INLINED(NEW_FRAME) \
162144
do { \
163145
assert(tstate->interp->eval_frame == NULL); \
@@ -167,7 +149,6 @@ do { \
167149
CALL_STAT_INC(inlined_py_calls); \
168150
goto start_frame; \
169151
} while (0)
170-
#endif
171152

172153
// Use this instead of 'goto error' so Tier 2 can go to a different label
173154
#define GOTO_ERROR(LABEL) goto LABEL

Python/generated_cases.c.h

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

0 commit comments

Comments
 (0)