diff options
author | Guido van Rossum <guido@python.org> | 2024-05-01 01:26:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-01 01:26:34 (GMT) |
commit | 7d83f7bcc484145596bae1ff015fed0762da345d (patch) | |
tree | f2f3cbb0cefaa920b319c77da00606fef1db48aa /configure | |
parent | 9c468e2c5dffb6fa9811fd16e70fa0463bdfce5f (diff) | |
download | cpython-7d83f7bcc484145596bae1ff015fed0762da345d.zip cpython-7d83f7bcc484145596bae1ff015fed0762da345d.tar.gz cpython-7d83f7bcc484145596bae1ff015fed0762da345d.tar.bz2 |
gh-118335: Configure Tier 2 interpreter at build time (#118339)
The code for Tier 2 is now only compiled when configured
with `--enable-experimental-jit[=yes|interpreter]`.
We drop support for `PYTHON_UOPS` and -`Xuops`,
but you can disable the interpreter or JIT
at runtime by setting `PYTHON_JIT=0`.
You can also build it without enabling it by default
using `--enable-experimental-jit=yes-off`;
enable with `PYTHON_JIT=1`.
On Windows, the `build.bat` script supports
`--experimental-jit`, `--experimental-jit-off`,
`--experimental-interpreter`.
In the C code, `_Py_JIT` is defined as before
when the JIT is enabled; the new variable
`_Py_TIER2` is defined when the JIT *or* the
interpreter is enabled. It is actually a bitmask:
1: JIT; 2: default-off; 4: interpreter.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1818,7 +1818,7 @@ Optional Features: --disable-gil enable experimental support for running without the GIL (default is no) --enable-pystats enable internal statistics gathering (default is no) - --enable-experimental-jit + --enable-experimental-jit[=no|yes|yes-off|interpreter] build the experimental just-in-time compiler (default is no) --enable-optimizations enable expensive, stable optimizations (PGO, etc.) @@ -8229,11 +8229,19 @@ else $as_nop enable_experimental_jit=no fi +case $enable_experimental_jit in + no) enable_experimental_jit=no ;; + yes) enable_experimental_jit="-D_Py_JIT -D_Py_TIER2=1" ;; + yes-off) enable_experimental_jit="-D_Py_JIT -D_Py_TIER2=3" ;; + interpreter) enable_experimental_jit="-D_Py_TIER2=4" ;; + interpreter-off) enable_experimental_jit="-D_Py_TIER2=6" ;; # Secret option + *) as_fn_error $? "invalid argument: --enable-experimental-jit=$enable_experimental_jit; expected no|yes|yes-off|interpreter" "$LINENO" 5 ;; +esac if test "x$enable_experimental_jit" = xno then : else $as_nop - as_fn_append CFLAGS_NODIST " -D_Py_JIT" + as_fn_append CFLAGS_NODIST " $enable_experimental_jit" REGEN_JIT_COMMAND="\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host" JIT_STENCILS_H="jit_stencils.h" if test "x$Py_DEBUG" = xtrue |