Skip to content

Commit 09065ee

Browse files
refactor
1 parent 665c0f6 commit 09065ee

File tree

2 files changed

+4
-32
lines changed

2 files changed

+4
-32
lines changed

Python/ceval.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -808,9 +808,10 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
808808
#ifdef Py_STATS
809809
int lastopcode = 0;
810810
#endif
811+
#ifndef Py_TAIL_CALL_INTERP
811812
uint8_t opcode; /* Current opcode */
812813
int oparg; /* Current opcode argument, if any */
813-
814+
#endif
814815
_PyInterpreterFrame entry_frame;
815816

816817

@@ -890,15 +891,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
890891
resume_frame:
891892
stack_pointer = _PyFrame_GetStackPointer(frame);
892893

893-
#ifdef LLTRACE
894-
{
895-
int lltrace = maybe_lltrace_resume_frame(frame, GLOBALS());
896-
frame->lltrace = lltrace;
897-
if (lltrace < 0) {
898-
goto exit_unwind;
899-
}
900-
}
901-
#endif
894+
LLTRACE_RESUME_FRAME();
902895

903896
#ifdef Py_DEBUG
904897
/* _PyEval_EvalFrameDefault() must not be called with an exception set,

Python/ceval_macros.h

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ do { \
144144
}
145145

146146
#ifdef Py_TAIL_CALL_INTERP
147-
#ifdef LLTRACE
148147
#define DISPATCH_INLINED(NEW_FRAME) \
149148
do { \
150149
assert(tstate->interp->eval_frame == NULL); \
@@ -157,31 +156,11 @@ do { \
157156
} \
158157
next_instr = frame->instr_ptr; \
159158
stack_pointer = _PyFrame_GetStackPointer(frame); \
160-
lltrace = maybe_lltrace_resume_frame(frame, GLOBALS()); \
161-
if (lltrace < 0) { \
162-
goto exit_unwind; \
163-
} \
159+
LLTRACE_RESUME_FRAME(); \
164160
NEXTOPARG(); \
165161
DISPATCH_GOTO(); \
166162
} while (0)
167163
#else
168-
#define DISPATCH_INLINED(NEW_FRAME) \
169-
do { \
170-
assert(tstate->interp->eval_frame == NULL); \
171-
_PyFrame_SetStackPointer(frame, stack_pointer); \
172-
assert((NEW_FRAME)->previous == frame); \
173-
frame = tstate->current_frame = (NEW_FRAME); \
174-
CALL_STAT_INC(inlined_py_calls); \
175-
if (_Py_EnterRecursivePy(tstate)) { \
176-
goto exit_unwind; \
177-
} \
178-
next_instr = frame->instr_ptr; \
179-
stack_pointer = _PyFrame_GetStackPointer(frame); \
180-
NEXTOPARG(); \
181-
DISPATCH_GOTO(); \
182-
} while (0)
183-
#endif
184-
#else
185164
#define DISPATCH_INLINED(NEW_FRAME) \
186165
do { \
187166
assert(tstate->interp->eval_frame == NULL); \

0 commit comments

Comments
 (0)