From 1b27f36eb0ef146aa60b261a1cffcc6fd55c0e88 Mon Sep 17 00:00:00 2001 From: Ken Jin Date: Thu, 13 Feb 2025 02:18:36 +0800 Subject: [PATCH] gh-129819: Allow tier2/JIT and tailcall (GH-129820) --- .../2025-02-11-08-06-44.gh-issue-129819.7rn4dY.rst | 1 + Python/ceval_macros.h | 2 +- configure | 12 ------------ configure.ac | 13 ------------- pyconfig.h.in | 2 +- 5 files changed, 3 insertions(+), 27 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2025-02-11-08-06-44.gh-issue-129819.7rn4dY.rst diff --git a/Misc/NEWS.d/next/Build/2025-02-11-08-06-44.gh-issue-129819.7rn4dY.rst b/Misc/NEWS.d/next/Build/2025-02-11-08-06-44.gh-issue-129819.7rn4dY.rst new file mode 100644 index 000000000000..2463e4dba24a --- /dev/null +++ b/Misc/NEWS.d/next/Build/2025-02-11-08-06-44.gh-issue-129819.7rn4dY.rst @@ -0,0 +1 @@ +Allow building the JIT with the tailcall interpreter. diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h index 50e940c19732..2cb78fa80b46 100644 --- a/Python/ceval_macros.h +++ b/Python/ceval_macros.h @@ -397,7 +397,7 @@ do { \ stack_pointer = _PyFrame_GetStackPointer(frame); \ if (next_instr == NULL) { \ next_instr = frame->instr_ptr; \ - goto error; \ + JUMP_TO_LABEL(error); \ } \ DISPATCH(); \ } while (0) diff --git a/configure b/configure index d46bc563a672..453b0123ded0 100755 --- a/configure +++ b/configure @@ -29284,18 +29284,6 @@ esac fi -# Do not enable tail-calling interpreter if tier 2 is enabled. -if ${tier2_flags:+false} : -then : - - case "$ac_cv_tail_call" in yes*) - -printf "%s\n" "#define Py_TAIL_CALL_INTERP 1" >>confdefs.h - - esac - -fi - case $ac_sys_system in AIX*) diff --git a/configure.ac b/configure.ac index faa890953038..234ae90616af 100644 --- a/configure.ac +++ b/configure.ac @@ -7033,19 +7033,6 @@ fi ], [AC_MSG_RESULT([no value specified])]) -# Do not enable tail-calling interpreter if tier 2 is enabled. -AS_VAR_IF( - [tier2_flags], - [], - [ - case "$ac_cv_tail_call" in yes*) - AC_DEFINE([Py_TAIL_CALL_INTERP], [1], - [Define if the C compiler supports efficient proper tail calls.]) - esac - ], - [] -) - case $ac_sys_system in AIX*) diff --git a/pyconfig.h.in b/pyconfig.h.in index 9ea01ad3fc0a..4295b4f5ea5f 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -1718,7 +1718,7 @@ /* The version of SunOS/Solaris as reported by `uname -r' without the dot. */ #undef Py_SUNOS_VERSION -/* Define if the C compiler supports efficient proper tail calls. */ +/* 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 */ -- 2.47.3