|
70 | 70 | #define INSTRUCTION_STATS(op) ((void)0) |
71 | 71 | #endif |
72 | 72 |
|
73 | | -#define TAIL_CALL_PARAMS _PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate, _Py_CODEUNIT *next_instr, int oparg |
74 | | -#define TAIL_CALL_ARGS frame, stack_pointer, tstate, next_instr, oparg |
| 73 | +#ifdef Py_STATS |
| 74 | +# define TAIL_CALL_PARAMS _PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate, _Py_CODEUNIT *next_instr, int oparg, int lastopcode |
| 75 | +# define TAIL_CALL_ARGS frame, stack_pointer, tstate, next_instr, oparg, lastopcode |
| 76 | +#else |
| 77 | +# define TAIL_CALL_PARAMS _PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate, _Py_CODEUNIT *next_instr, int oparg |
| 78 | +# define TAIL_CALL_ARGS frame, stack_pointer, tstate, next_instr, oparg |
| 79 | +#endif |
75 | 80 |
|
76 | 81 | #if Py_TAIL_CALL_INTERP |
77 | 82 | // Note: [[clang::musttail]] works for GCC 15, but not __attribute__((musttail)) at the moment. |
|
88 | 93 | do { \ |
89 | 94 | Py_MUSTTAIL return (_TAIL_CALL_##name)(TAIL_CALL_ARGS); \ |
90 | 95 | } while (0) |
91 | | -# define JUMP_TO_PREDICTED(name) \ |
92 | | - do { \ |
93 | | - Py_MUSTTAIL return (_TAIL_CALL_##name)(frame, stack_pointer, tstate, this_instr, oparg); \ |
94 | | - } while (0) |
| 96 | +# ifdef Py_STATS |
| 97 | +# define JUMP_TO_PREDICTED(name) \ |
| 98 | + do { \ |
| 99 | + Py_MUSTTAIL return (_TAIL_CALL_##name)(frame, stack_pointer, tstate, this_instr, oparg, lastopcode); \ |
| 100 | + } while (0) |
| 101 | +# else |
| 102 | +# define JUMP_TO_PREDICTED(name) \ |
| 103 | + do { \ |
| 104 | + Py_MUSTTAIL return (_TAIL_CALL_##name)(frame, stack_pointer, tstate, this_instr, oparg); \ |
| 105 | + } while (0) |
| 106 | +# endif |
95 | 107 | # define LABEL(name) TARGET(name) |
96 | 108 | #elif USE_COMPUTED_GOTOS |
97 | 109 | # define TARGET(op) TARGET_##op: |
|
0 commit comments