Skip to content

Commit f5b1c93

Browse files
Generate everything
1 parent 5862338 commit f5b1c93

File tree

4 files changed

+605
-3010
lines changed

4 files changed

+605
-3010
lines changed

Python/ceval.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
910910
DISPATCH();
911911
#endif
912912

913-
{
914913
#ifndef Py_TAIL_CALL_INTERP
915914
/* Start instructions */
916915
#if !USE_COMPUTED_GOTOS
@@ -942,15 +941,15 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
942941
or goto error. */
943942
Py_UNREACHABLE();
944943
#endif
945-
pop_4_error:
944+
TAIL_CALL_TARGET(pop_4_error):
946945
STACK_SHRINK(1);
947-
pop_3_error:
946+
TAIL_CALL_TARGET(pop_3_error):
948947
STACK_SHRINK(1);
949-
pop_2_error:
948+
TAIL_CALL_TARGET(pop_2_error):
950949
STACK_SHRINK(1);
951-
pop_1_error:
950+
TAIL_CALL_TARGET(pop_1_error):
952951
STACK_SHRINK(1);
953-
error:
952+
TAIL_CALL_TARGET(error):
954953
/* Double-check exception status. */
955954
#ifdef NDEBUG
956955
if (!_PyErr_Occurred(tstate)) {
@@ -970,7 +969,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
970969
}
971970
}
972971
_PyEval_MonitorRaise(tstate, frame, next_instr-1);
973-
exception_unwind:
972+
TAIL_CALL_TARGET(exception_unwind):
974973
{
975974
/* We can't use frame->instr_ptr here, as RERAISE may have set it */
976975
int offset = INSTR_OFFSET()-1;
@@ -1032,9 +1031,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10321031
DISPATCH();
10331032
#endif
10341033
}
1035-
}
10361034

1037-
exit_unwind:
1035+
TAIL_CALL_TARGET(exit_unwind):
10381036
assert(_PyErr_Occurred(tstate));
10391037
_Py_LeaveRecursiveCallPy(tstate);
10401038
assert(frame != entry_frame);
@@ -1050,12 +1048,12 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10501048
return NULL;
10511049
}
10521050

1053-
resume_with_error:
1051+
TAIL_CALL_TARGET(resume_with_error):
10541052
next_instr = frame->instr_ptr;
10551053
stack_pointer = _PyFrame_GetStackPointer(frame);
10561054
goto error;
10571055

1058-
1056+
/* END_BASE_INTERPRETER */
10591057
#ifdef _Py_TIER2
10601058

10611059
// Tier 2 is also here!
@@ -1197,7 +1195,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
11971195

11981196
#endif // _Py_TIER2
11991197

1200-
}
1198+
} /* _PyEval_EvalFrameDefault */
12011199

12021200
#ifdef DO_NOT_OPTIMIZE_INTERP_LOOP
12031201
# pragma optimize("", on)

Python/ceval_macros.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@
102102
# define CEVAL_GOTO(name) goto name;
103103
#endif
104104

105+
#define TAIL_CALL_TARGET(name) name
106+
105107

106108
/* PRE_DISPATCH_GOTO() does lltrace if enabled. Normally a no-op */
107109
#ifdef LLTRACE

0 commit comments

Comments
 (0)