gh-135755: Make Py_TAIL_CALL_INTERP macro private (#138981)

Rename Py_TAIL_CALL_INTERP to _Py_TAIL_CALL_INTERP.
This commit is contained in:
Victor Stinner
2025-09-18 13:33:07 +01:00
committed by GitHub
parent 2191497933
commit 6504f20cce
12 changed files with 315 additions and 315 deletions

View File

@@ -1219,7 +1219,7 @@ dummy_func(
tstate->current_frame = frame->previous;
assert(!_PyErr_Occurred(tstate));
PyObject *result = PyStackRef_AsPyObjectSteal(retval);
#if !Py_TAIL_CALL_INTERP
#if !_Py_TAIL_CALL_INTERP
assert(frame == &entry.frame);
#endif
#ifdef _Py_TIER2
@@ -1509,7 +1509,7 @@ dummy_func(
tier1 inst(CLEANUP_THROW, (sub_iter, last_sent_val, exc_value_st -- none, value)) {
PyObject *exc_value = PyStackRef_AsPyObjectBorrow(exc_value_st);
#if !Py_TAIL_CALL_INTERP
#if !_Py_TAIL_CALL_INTERP
assert(throwflag);
#endif
assert(exc_value && PyExceptionInstance_Check(exc_value));
@@ -5515,7 +5515,7 @@ dummy_func(
}
#endif
RELOAD_STACK();
#if Py_TAIL_CALL_INTERP
#if _Py_TAIL_CALL_INTERP
int opcode;
#endif
DISPATCH();
@@ -5533,7 +5533,7 @@ dummy_func(
if (frame->owner == FRAME_OWNED_BY_INTERPRETER) {
/* Restore previous frame and exit */
tstate->current_frame = frame->previous;
#if !Py_TAIL_CALL_INTERP
#if !_Py_TAIL_CALL_INTERP
assert(frame == &entry.frame);
#endif
#ifdef _Py_TIER2
@@ -5569,7 +5569,7 @@ dummy_func(
assert(!_PyErr_Occurred(tstate));
#endif
RELOAD_STACK();
#if Py_TAIL_CALL_INTERP
#if _Py_TAIL_CALL_INTERP
int opcode;
#endif
DISPATCH();

View File

@@ -987,7 +987,7 @@ _PyObjectArray_Free(PyObject **array, PyObject **scratch)
/* This setting is reversed below following _PyEval_EvalFrameDefault */
#endif
#if Py_TAIL_CALL_INTERP
#if _Py_TAIL_CALL_INTERP
#include "opcode_targets.h"
#include "generated_cases.c.h"
#endif
@@ -1019,7 +1019,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
check_invalid_reentrancy();
CALL_STAT_INC(pyeval_calls);
#if USE_COMPUTED_GOTOS && !Py_TAIL_CALL_INTERP
#if USE_COMPUTED_GOTOS && !_Py_TAIL_CALL_INTERP
/* Import the static jump table */
#include "opcode_targets.h"
#endif
@@ -1027,7 +1027,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
#ifdef Py_STATS
int lastopcode = 0;
#endif
#if !Py_TAIL_CALL_INTERP
#if !_Py_TAIL_CALL_INTERP
uint8_t opcode; /* Current opcode */
int oparg; /* Current opcode argument, if any */
assert(tstate->current_frame == NULL || tstate->current_frame->stackpointer != NULL);
@@ -1099,7 +1099,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
next_instr = frame->instr_ptr;
monitor_throw(tstate, frame, next_instr);
stack_pointer = _PyFrame_GetStackPointer(frame);
#if Py_TAIL_CALL_INTERP
#if _Py_TAIL_CALL_INTERP
# if Py_STATS
return _TAIL_CALL_error(frame, stack_pointer, tstate, next_instr, 0, lastopcode);
# else
@@ -1110,7 +1110,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
#endif
}
#if Py_TAIL_CALL_INTERP
#if _Py_TAIL_CALL_INTERP
# if Py_STATS
return _TAIL_CALL_start_frame(frame, NULL, tstate, NULL, 0, lastopcode);
# else

View File

@@ -78,7 +78,7 @@
# define TAIL_CALL_ARGS frame, stack_pointer, tstate, next_instr, oparg
#endif
#if Py_TAIL_CALL_INTERP
#if _Py_TAIL_CALL_INTERP
// Note: [[clang::musttail]] works for GCC 15, but not __attribute__((musttail)) at the moment.
# define Py_MUSTTAIL [[clang::musttail]]
# define Py_PRESERVE_NONE_CC __attribute__((preserve_none))

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
#if !Py_TAIL_CALL_INTERP
#if !_Py_TAIL_CALL_INTERP
static void *opcode_targets[256] = {
&&TARGET_CACHE,
&&TARGET_BINARY_SLICE,
@@ -257,7 +257,7 @@ static void *opcode_targets[256] = {
&&TARGET_INSTRUMENTED_LINE,
&&TARGET_ENTER_EXECUTOR,
};
#else /* Py_TAIL_CALL_INTERP */
#else /* _Py_TAIL_CALL_INTERP */
static py_tail_call_funcptr INSTRUCTION_TABLE[256];
Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_pop_2_error(TAIL_CALL_PARAMS);
@@ -761,4 +761,4 @@ static py_tail_call_funcptr INSTRUCTION_TABLE[256] = {
[232] = _TAIL_CALL_UNKNOWN_OPCODE,
[233] = _TAIL_CALL_UNKNOWN_OPCODE,
};
#endif /* Py_TAIL_CALL_INTERP */
#endif /* _Py_TAIL_CALL_INTERP */