mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
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:
parent
2191497933
commit
6504f20cce
12 changed files with 315 additions and 315 deletions
|
|
@ -132,7 +132,7 @@ def test_inst_no_args(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -154,7 +154,7 @@ def test_inst_one_pop(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -179,7 +179,7 @@ def test_inst_one_push(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -205,7 +205,7 @@ def test_inst_one_push_one_pop(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -232,7 +232,7 @@ def test_binary_op(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -262,7 +262,7 @@ def test_overlap(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -296,7 +296,7 @@ def test_predictions(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP1) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP1;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -313,7 +313,7 @@ def test_predictions(self):
|
|||
}
|
||||
|
||||
TARGET(OP3) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP3;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -355,7 +355,7 @@ def test_sync_sp(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(A) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = A;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -378,7 +378,7 @@ def test_sync_sp(self):
|
|||
}
|
||||
|
||||
TARGET(B) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = B;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -421,7 +421,7 @@ def test_error_if_plain(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -444,7 +444,7 @@ def test_error_if_plain_with_comment(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -470,7 +470,7 @@ def test_error_if_pop(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -505,7 +505,7 @@ def test_error_if_pop_with_result(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -537,7 +537,7 @@ def test_cache_effect(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -570,7 +570,7 @@ def test_suppress_dispatch(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -604,7 +604,7 @@ def test_macro_instruction(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -645,7 +645,7 @@ def test_macro_instruction(self):
|
|||
}
|
||||
|
||||
TARGET(OP1) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP1;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -667,7 +667,7 @@ def test_macro_instruction(self):
|
|||
}
|
||||
|
||||
TARGET(OP3) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP3;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -702,7 +702,7 @@ def test_unused_caches(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -728,7 +728,7 @@ def test_pseudo_instruction_no_flags(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP1) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP1;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -751,7 +751,7 @@ def test_pseudo_instruction_with_flags(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP1) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP1;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -777,7 +777,7 @@ def test_pseudo_instruction_as_sequence(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP1) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP1;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -788,7 +788,7 @@ def test_pseudo_instruction_as_sequence(self):
|
|||
}
|
||||
|
||||
TARGET(OP2) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP2;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -812,7 +812,7 @@ def test_array_input(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -843,7 +843,7 @@ def test_array_output(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -875,7 +875,7 @@ def test_array_input_output(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -905,7 +905,7 @@ def test_array_error_if(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -940,7 +940,7 @@ def test_macro_push_push(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(M) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = M;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -977,7 +977,7 @@ def test_override_inst(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1002,7 +1002,7 @@ def test_override_op(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(M) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = M;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1023,7 +1023,7 @@ def test_annotated_inst(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1045,7 +1045,7 @@ def test_annotated_op(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(M) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = M;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1086,7 +1086,7 @@ def test_array_of_one(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1128,7 +1128,7 @@ def test_unused_named_values(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(INST) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = INST;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1158,7 +1158,7 @@ def test_used_unused_used(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(TEST) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = TEST;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1202,7 +1202,7 @@ def test_unused_used_used(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(TEST) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = TEST;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1245,7 +1245,7 @@ def test_flush(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(TEST) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = TEST;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1297,7 +1297,7 @@ def test_pop_on_error_peeks(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(TEST) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = TEST;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1348,7 +1348,7 @@ def test_push_then_error(self):
|
|||
|
||||
output = """
|
||||
TARGET(TEST) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = TEST;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1393,7 +1393,7 @@ def test_error_if_true(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP1) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP1;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1404,7 +1404,7 @@ def test_error_if_true(self):
|
|||
}
|
||||
|
||||
TARGET(OP2) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP2;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1466,7 +1466,7 @@ def test_stack_save_reload(self):
|
|||
|
||||
output = """
|
||||
TARGET(BALANCED) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = BALANCED;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1492,7 +1492,7 @@ def test_stack_save_reload_paired(self):
|
|||
|
||||
output = """
|
||||
TARGET(BALANCED) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = BALANCED;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1514,7 +1514,7 @@ def test_stack_reload_only(self):
|
|||
|
||||
output = """
|
||||
TARGET(BALANCED) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = BALANCED;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1539,7 +1539,7 @@ def test_stack_save_only(self):
|
|||
|
||||
output = """
|
||||
TARGET(BALANCED) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = BALANCED;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1565,7 +1565,7 @@ def test_instruction_size_macro(self):
|
|||
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1604,7 +1604,7 @@ def test_escaping_call_next_to_cmacro(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1642,7 +1642,7 @@ def test_pystackref_frompyobject_new_next_to_cmacro(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1840,7 +1840,7 @@ def test_reassigning_live_inputs(self):
|
|||
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
@ -1867,7 +1867,7 @@ def test_reassigning_dead_inputs(self):
|
|||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
#if Py_TAIL_CALL_INTERP
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
int opcode = OP;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@
|
|||
<PreprocessorDefinitions Condition="$(IncludeExternals)">_Py_HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(UseJIT)' == 'true'">_Py_JIT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(UseTIER2)' != '' and '$(UseTIER2)' != '0'">_Py_TIER2=$(UseTIER2);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(UseTailCallInterp)' == 'true'">Py_TAIL_CALL_INTERP=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(UseTailCallInterp)' == 'true'">_Py_TAIL_CALL_INTERP=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(WITH_COMPUTED_GOTOS)' != ''">HAVE_COMPUTED_GOTOS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(DisableRemoteDebug)' != 'true'">Py_REMOTE_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
468
Python/generated_cases.c.h
generated
468
Python/generated_cases.c.h
generated
File diff suppressed because it is too large
Load diff
6
Python/opcode_targets.h
generated
6
Python/opcode_targets.h
generated
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -26,12 +26,12 @@ def write_opcode_targets(analysis: Analysis, out: CWriter) -> None:
|
|||
for name, op in analysis.opmap.items():
|
||||
if op < 256:
|
||||
targets[op] = f"&&TARGET_{name},\n"
|
||||
out.emit("#if !Py_TAIL_CALL_INTERP\n")
|
||||
out.emit("#if !_Py_TAIL_CALL_INTERP\n")
|
||||
out.emit("static void *opcode_targets[256] = {\n")
|
||||
for target in targets:
|
||||
out.emit(target)
|
||||
out.emit("};\n")
|
||||
out.emit("#else /* Py_TAIL_CALL_INTERP */\n")
|
||||
out.emit("#else /* _Py_TAIL_CALL_INTERP */\n")
|
||||
|
||||
def function_proto(name: str) -> str:
|
||||
return f"Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_{name}(TAIL_CALL_PARAMS)"
|
||||
|
|
@ -68,7 +68,7 @@ def write_tailcall_dispatch_table(analysis: Analysis, out: CWriter) -> None:
|
|||
if rest not in named_values:
|
||||
out.emit(f"[{rest}] = _TAIL_CALL_UNKNOWN_OPCODE,\n")
|
||||
out.emit("};\n")
|
||||
outfile.write("#endif /* Py_TAIL_CALL_INTERP */\n")
|
||||
outfile.write("#endif /* _Py_TAIL_CALL_INTERP */\n")
|
||||
|
||||
arg_parser = argparse.ArgumentParser(
|
||||
description="Generate the file with dispatch targets.",
|
||||
|
|
|
|||
|
|
@ -157,20 +157,20 @@ def generate_tier1(
|
|||
#define TIER_ONE 1
|
||||
""")
|
||||
outfile.write(f"""
|
||||
#if !Py_TAIL_CALL_INTERP
|
||||
#if !_Py_TAIL_CALL_INTERP
|
||||
#if !USE_COMPUTED_GOTOS
|
||||
dispatch_opcode:
|
||||
switch (opcode)
|
||||
#endif
|
||||
{{
|
||||
#endif /* Py_TAIL_CALL_INTERP */
|
||||
#endif /* _Py_TAIL_CALL_INTERP */
|
||||
{INSTRUCTION_START_MARKER}
|
||||
"""
|
||||
)
|
||||
generate_tier1_cases(analysis, outfile, lines)
|
||||
outfile.write(f"""
|
||||
{INSTRUCTION_END_MARKER}
|
||||
#if !Py_TAIL_CALL_INTERP
|
||||
#if !_Py_TAIL_CALL_INTERP
|
||||
#if USE_COMPUTED_GOTOS
|
||||
_unknown_opcode:
|
||||
#else
|
||||
|
|
@ -186,7 +186,7 @@ def generate_tier1(
|
|||
/* This should never be reached. Every opcode should end with DISPATCH()
|
||||
or goto error. */
|
||||
Py_UNREACHABLE();
|
||||
#endif /* Py_TAIL_CALL_INTERP */
|
||||
#endif /* _Py_TAIL_CALL_INTERP */
|
||||
{LABEL_START_MARKER}
|
||||
""")
|
||||
out = CWriter(outfile, 2, lines)
|
||||
|
|
@ -226,7 +226,7 @@ def generate_tier1_cases(
|
|||
popped = get_popped(inst, analysis)
|
||||
# We need to ifdef it because this breaks platforms
|
||||
# without computed gotos/tail calling.
|
||||
out.emit(f"#if Py_TAIL_CALL_INTERP\n")
|
||||
out.emit(f"#if _Py_TAIL_CALL_INTERP\n")
|
||||
out.emit(f"int opcode = {name};\n")
|
||||
out.emit(f"(void)(opcode);\n")
|
||||
out.emit(f"#endif\n")
|
||||
|
|
|
|||
4
configure
generated
vendored
4
configure
generated
vendored
|
|
@ -29814,7 +29814,7 @@ then :
|
|||
if test "$withval" = yes
|
||||
then
|
||||
|
||||
printf "%s\n" "#define Py_TAIL_CALL_INTERP 1" >>confdefs.h
|
||||
printf "%s\n" "#define _Py_TAIL_CALL_INTERP 1" >>confdefs.h
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
printf "%s\n" "yes" >&6; }
|
||||
|
|
@ -29822,7 +29822,7 @@ fi
|
|||
if test "$withval" = no
|
||||
then
|
||||
|
||||
printf "%s\n" "#define Py_TAIL_CALL_INTERP 0" >>confdefs.h
|
||||
printf "%s\n" "#define _Py_TAIL_CALL_INTERP 0" >>confdefs.h
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
printf "%s\n" "no" >&6; }
|
||||
|
|
|
|||
|
|
@ -7107,13 +7107,13 @@ AC_ARG_WITH(
|
|||
[
|
||||
if test "$withval" = yes
|
||||
then
|
||||
AC_DEFINE([Py_TAIL_CALL_INTERP], [1],
|
||||
AC_DEFINE([_Py_TAIL_CALL_INTERP], [1],
|
||||
[Define if you want to use tail-calling interpreters in CPython.])
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
if test "$withval" = no
|
||||
then
|
||||
AC_DEFINE([Py_TAIL_CALL_INTERP], [0],
|
||||
AC_DEFINE([_Py_TAIL_CALL_INTERP], [0],
|
||||
[Define if you want to use tail-calling interpreters in CPython.])
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1752,9 +1752,6 @@
|
|||
/* The version of SunOS/Solaris as reported by `uname -r' without the dot. */
|
||||
#undef Py_SUNOS_VERSION
|
||||
|
||||
/* Define if you want to use tail-calling interpreters in CPython. */
|
||||
#undef Py_TAIL_CALL_INTERP
|
||||
|
||||
/* Define if you want to enable tracing references for debugging purpose */
|
||||
#undef Py_TRACE_REFS
|
||||
|
||||
|
|
@ -2026,6 +2023,9 @@
|
|||
/* HACL* library can compile SIMD256 implementations */
|
||||
#undef _Py_HACL_CAN_COMPILE_VEC256
|
||||
|
||||
/* Define if you want to use tail-calling interpreters in CPython. */
|
||||
#undef _Py_TAIL_CALL_INTERP
|
||||
|
||||
/* Define to force use of thread-safe errno, h_errno, and other functions */
|
||||
#undef _REENTRANT
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue