From 9e86e9985244e0f693719ebc19988dadcb31b5c7 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Sun, 16 Mar 2025 09:02:44 -0500 Subject: [PATCH 1/2] Bump to CPython 3.14.0a6 --- pythonbuild/downloads.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pythonbuild/downloads.py b/pythonbuild/downloads.py index 0340a68a..158171ab 100644 --- a/pythonbuild/downloads.py +++ b/pythonbuild/downloads.py @@ -80,10 +80,10 @@ "python_tag": "cp313", }, "cpython-3.14": { - "url": "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a5.tar.xz", - "size": 22859900, - "sha256": "74e83f26de1e4fb9eef1b56492cff92508834bb71ac13f5c580438ce9f093682", - "version": "3.14.0a5", + "url": "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a6.tar.xz", + "size": 22956068, + "sha256": "8d6181e5331d9a2cd6ca405ae1230e88589a043f4768ebb443d3889d45c1c35c", + "version": "3.14.0a6", "licenses": ["Python-2.0", "CNRI-Python"], "license_file": "LICENSE.cpython.txt", "python_tag": "cp314", From 85b87ae7a81f6ff985e97962f60ddbe284457af4 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 17 Mar 2025 09:33:25 -0500 Subject: [PATCH 2/2] Remove `patch-jit-tail-call-compat-314-129820.patch` --- cpython-unix/build-cpython.sh | 3 - ...atch-jit-tail-call-compat-314-129820.patch | 227 ------------------ 2 files changed, 230 deletions(-) delete mode 100644 cpython-unix/patch-jit-tail-call-compat-314-129820.patch diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 350be3cf..5e66f053 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -448,9 +448,6 @@ if [ -n "${CPYTHON_OPTIMIZED}" ]; then if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_14}" ]]; then patch -p1 -i "${ROOT}/patch-jit-llvm-version-3.14.patch" - # On 3.14, we also use the tail calling interpreter which was incompatible with the JIT - # until https://github.com/python/cpython/pull/129820 — backport that - patch -p1 -i "${ROOT}/patch-jit-tail-call-compat-314-129820.patch" fi fi fi diff --git a/cpython-unix/patch-jit-tail-call-compat-314-129820.patch b/cpython-unix/patch-jit-tail-call-compat-314-129820.patch deleted file mode 100644 index c612c5bc..00000000 --- a/cpython-unix/patch-jit-tail-call-compat-314-129820.patch +++ /dev/null @@ -1,227 +0,0 @@ -diff --git a/configure b/configure -index 65b8e711cdccae..ee47feafc73fc1 100755 ---- a/configure -+++ b/configure -@@ -29281,18 +29281,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 0c6063d87d654a..c68938ba9e168d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -7041,19 +7041,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 9ea01ad3fc0a31..4295b4f5ea5fbd 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 */ - -From dae88e3ca730576256a0b8d2bc9e78b8cacab645 Mon Sep 17 00:00:00 2001 -From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> -Date: Sat, 8 Feb 2025 01:32:05 +0800 -Subject: [PATCH 2/6] Get JIT working minimally with tailcalling interpreter - ---- - Python/ceval_macros.h | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h -index 44bb52a09aab5f..2c7729743b1705 100644 ---- a/Python/ceval_macros.h -+++ b/Python/ceval_macros.h -@@ -384,6 +384,24 @@ _PyFrame_SetStackPointer(frame, stack_pointer) - /* Tier-switching macros. */ - - #ifdef _Py_JIT -+#ifdef Py_TAIL_CALL_INTERP -+#define GOTO_TIER_TWO(EXECUTOR) \ -+do { \ -+ OPT_STAT_INC(traces_executed); \ -+ jit_func jitted = (EXECUTOR)->jit_code; \ -+ next_instr = jitted(frame, stack_pointer, tstate); \ -+ Py_DECREF(tstate->previous_executor); \ -+ tstate->previous_executor = NULL; \ -+ frame = tstate->current_frame; \ -+ if (next_instr == NULL) { \ -+ next_instr = frame->instr_ptr; \ -+ stack_pointer = _PyFrame_GetStackPointer(frame); \ -+ return _TAIL_CALL_error(TAIL_CALL_ARGS); \ -+ } \ -+ stack_pointer = _PyFrame_GetStackPointer(frame); \ -+ DISPATCH(); \ -+} while (0) -+#else - #define GOTO_TIER_TWO(EXECUTOR) \ - do { \ - OPT_STAT_INC(traces_executed); \ -@@ -400,6 +418,7 @@ do { \ - stack_pointer = _PyFrame_GetStackPointer(frame); \ - DISPATCH(); \ - } while (0) -+#endif - #else - #define GOTO_TIER_TWO(EXECUTOR) \ - do { \ - -From 230d497620d73e17a099326f7e54078e91254e5a Mon Sep 17 00:00:00 2001 -From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> -Date: Tue, 11 Feb 2025 16:05:57 +0800 -Subject: [PATCH 3/6] Update ceval_macros.h - ---- - Python/ceval_macros.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h -index 2c7729743b1705..0f4dd61f367dbb 100644 ---- a/Python/ceval_macros.h -+++ b/Python/ceval_macros.h -@@ -384,7 +384,7 @@ _PyFrame_SetStackPointer(frame, stack_pointer) - /* Tier-switching macros. */ - - #ifdef _Py_JIT --#ifdef Py_TAIL_CALL_INTERP -+#if Py_TAIL_CALL_INTERP - #define GOTO_TIER_TWO(EXECUTOR) \ - do { \ - OPT_STAT_INC(traces_executed); \ - -From c46391470ca8b4d6a4b9c0d9f75c7fcce6ac303a Mon Sep 17 00:00:00 2001 -From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> -Date: Tue, 11 Feb 2025 08:06:47 +0000 -Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= - =?UTF-8?q?rb=5Fit.?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - ---- - .../next/Build/2025-02-11-08-06-44.gh-issue-129819.7rn4dY.rst | 1 + - 1 file changed, 1 insertion(+) - 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 00000000000000..2463e4dba24ae9 ---- /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. - -From 105ab11ce4fcc3d659ccaf36197ea281b853e23a Mon Sep 17 00:00:00 2001 -From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> -Date: Wed, 12 Feb 2025 16:14:23 +0800 -Subject: [PATCH 5/6] Address review - ---- - Python/ceval_macros.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h -index 0f4dd61f367dbb..9562ad9d349a11 100644 ---- a/Python/ceval_macros.h -+++ b/Python/ceval_macros.h -@@ -396,7 +396,7 @@ do { \ - if (next_instr == NULL) { \ - next_instr = frame->instr_ptr; \ - stack_pointer = _PyFrame_GetStackPointer(frame); \ -- return _TAIL_CALL_error(TAIL_CALL_ARGS); \ -+ return JUMP_TO_LABEL(error); \ - } \ - stack_pointer = _PyFrame_GetStackPointer(frame); \ - DISPATCH(); \ - -From 76c2c96fed4abc68e8879f3d65755d5cba8a4b16 Mon Sep 17 00:00:00 2001 -From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> -Date: Thu, 13 Feb 2025 01:06:07 +0800 -Subject: [PATCH 6/6] one-liner - ---- - Python/ceval_macros.h | 21 +-------------------- - 1 file changed, 1 insertion(+), 20 deletions(-) - -diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h -index 2422bf3bcf38f1..4f0071d5e1a09f 100644 ---- a/Python/ceval_macros.h -+++ b/Python/ceval_macros.h -@@ -381,24 +381,6 @@ _PyFrame_SetStackPointer(frame, stack_pointer) - /* Tier-switching macros. */ - - #ifdef _Py_JIT --#if Py_TAIL_CALL_INTERP --#define GOTO_TIER_TWO(EXECUTOR) \ --do { \ -- OPT_STAT_INC(traces_executed); \ -- jit_func jitted = (EXECUTOR)->jit_code; \ -- next_instr = jitted(frame, stack_pointer, tstate); \ -- Py_DECREF(tstate->previous_executor); \ -- tstate->previous_executor = NULL; \ -- frame = tstate->current_frame; \ -- if (next_instr == NULL) { \ -- next_instr = frame->instr_ptr; \ -- stack_pointer = _PyFrame_GetStackPointer(frame); \ -- return JUMP_TO_LABEL(error); \ -- } \ -- stack_pointer = _PyFrame_GetStackPointer(frame); \ -- DISPATCH(); \ --} while (0) --#else - #define GOTO_TIER_TWO(EXECUTOR) \ - do { \ - OPT_STAT_INC(traces_executed); \ -@@ -413,11 +395,10 @@ do { \ - stack_pointer = _PyFrame_GetStackPointer(frame); \ - if (next_instr == NULL) { \ - next_instr = frame->instr_ptr; \ -- goto error; \ -+ JUMP_TO_LABEL(error); \ - } \ - DISPATCH(); \ - } while (0) --#endif - #else - #define GOTO_TIER_TWO(EXECUTOR) \ - do { \