Skip to content

Commit 5862338

Browse files
more cleanup
1 parent 9820340 commit 5862338

File tree

2 files changed

+14
-24
lines changed

2 files changed

+14
-24
lines changed

Python/ceval.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -783,24 +783,12 @@ _PyObjectArray_Free(PyObject **array, PyObject **scratch)
783783

784784
#ifdef Py_TAIL_CALL_INTERP
785785
#include "generated_tail_call_handlers.c.h"
786-
# ifdef LLTRACE
787-
static inline PyObject *
788-
_TAIL_CALL_shim(_PyInterpreterFrame *frame, _PyStackRef *stack_pointer,
789-
PyThreadState *tstate, _Py_CODEUNIT *next_instr, int oparg, _PyInterpreterFrame* entry_frame, int lltrace)
790-
{
791-
return (INSTRUCTION_TABLE[next_instr->op.code])(frame, stack_pointer, tstate, next_instr, next_instr->op.arg, entry_frame, lltrace);
792-
}
793-
# else
794-
static inline PyObject *
795-
_TAIL_CALL_shim(_PyInterpreterFrame *frame, _PyStackRef *stack_pointer,
796-
PyThreadState *tstate, _Py_CODEUNIT *next_instr, int oparg, _PyInterpreterFrame* entry_frame)
797-
{
798-
return (INSTRUCTION_TABLE[next_instr->op.code])(frame, stack_pointer, tstate, next_instr, next_instr->op.arg, entry_frame);
799-
}
800-
# endif
786+
static inline PyObject *_TAIL_CALL_shim(TAIL_CALL_PARAMS)
787+
{
788+
return (INSTRUCTION_TABLE[next_instr->op.code])(frame, stack_pointer, tstate, next_instr, next_instr->op.arg, entry_frame);
789+
}
801790
#endif
802791

803-
804792
PyObject* _Py_HOT_FUNCTION
805793
_PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int throwflag)
806794
{

Python/ceval_macros.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,19 @@
7070
#define INSTRUCTION_STATS(op) ((void)0)
7171
#endif
7272

73+
#ifdef LLTRACE
74+
# define TAIL_CALL_PARAMS _PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate, _Py_CODEUNIT *next_instr, int oparg, _PyInterpreterFrame *entry_frame, int lltrace
75+
# define TAIL_CALL_ARGS frame, stack_pointer, tstate, next_instr, oparg, entry_frame, lltrace
76+
#else
77+
# define TAIL_CALL_PARAMS _PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate, _Py_CODEUNIT *next_instr, int oparg, _PyInterpreterFrame *entry_frame
78+
# define TAIL_CALL_ARGS frame, stack_pointer, tstate, next_instr, oparg, entry_frame
79+
#endif
80+
7381
#ifdef Py_TAIL_CALL_INTERP
7482
# define Py_MUSTTAIL __attribute__((musttail))
7583
# define Py_PRESERVE_NONE_CC __attribute__((preserve_none))
76-
# ifdef LLTRACE
77-
Py_PRESERVE_NONE_CC
78-
typedef PyObject* (*py_tail_call_funcptr)(_PyInterpreterFrame *, _PyStackRef *, PyThreadState *tstate, _Py_CODEUNIT *, int, _PyInterpreterFrame *, int);
79-
# define TAIL_CALL_ARGS frame, stack_pointer, tstate, next_instr, oparg, entry_frame, lltrace
80-
# else
8184
Py_PRESERVE_NONE_CC
82-
typedef PyObject* (*py_tail_call_funcptr)(_PyInterpreterFrame *, _PyStackRef *, PyThreadState *tstate, _Py_CODEUNIT *, int, _PyInterpreterFrame *);
83-
# define TAIL_CALL_ARGS frame, stack_pointer, tstate, next_instr, oparg, entry_frame
84-
# endif
85+
typedef PyObject* (*py_tail_call_funcptr)(TAIL_CALL_PARAMS);
8586
# define DISPATCH_GOTO() do { \
8687
Py_MUSTTAIL \
8788
return (INSTRUCTION_TABLE[opcode])(TAIL_CALL_ARGS); \
@@ -90,6 +91,7 @@
9091
Py_MUSTTAIL \
9192
return (_TAIL_CALL_##name)(TAIL_CALL_ARGS); \
9293
} while (0)
94+
9395
#elif USE_COMPUTED_GOTOS
9496
# define TARGET(op) TARGET_##op:
9597
# define DISPATCH_GOTO() goto *opcode_targets[opcode]

0 commit comments

Comments
 (0)