|
70 | 70 | #define INSTRUCTION_STATS(op) ((void)0) |
71 | 71 | #endif |
72 | 72 |
|
| 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 | + |
73 | 81 | #ifdef Py_TAIL_CALL_INTERP |
74 | 82 | # define Py_MUSTTAIL __attribute__((musttail)) |
75 | 83 | # 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 |
81 | 84 | 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); |
85 | 86 | # define DISPATCH_GOTO() do { \ |
86 | 87 | Py_MUSTTAIL \ |
87 | 88 | return (INSTRUCTION_TABLE[opcode])(TAIL_CALL_ARGS); \ |
|
90 | 91 | Py_MUSTTAIL \ |
91 | 92 | return (_TAIL_CALL_##name)(TAIL_CALL_ARGS); \ |
92 | 93 | } while (0) |
| 94 | + |
93 | 95 | #elif USE_COMPUTED_GOTOS |
94 | 96 | # define TARGET(op) TARGET_##op: |
95 | 97 | # define DISPATCH_GOTO() goto *opcode_targets[opcode] |
|
0 commit comments