@@ -888,7 +888,7 @@ Experimental JIT Compiler
888
888
=========================
889
889
890
890
When CPython is configured using the ``--enable-experimental-jit `` option,
891
- a just-in-time compiler is added which can speed up some Python programs.
891
+ a just-in-time compiler is added which may speed up some Python programs.
892
892
893
893
The internal architecture is roughly as follows.
894
894
@@ -905,18 +905,35 @@ The internal architecture is roughly as follows.
905
905
before it is interpreted or translated to machine code.
906
906
907
907
* There is a Tier 2 interpreter, but it is mostly intended for debugging
908
- the earlier stages of the optimization pipeline. If the JIT is not
909
- enabled, the Tier 2 interpreter can be enabled by configuring Python
910
- with the ``--enable-experimental-tier2 `` option .
908
+ the earlier stages of the optimization pipeline.
909
+ The Tier 2 interpreter can be enabled by configuring Python
910
+ with ``--enable-experimental-jit=interpreter `` .
911
911
912
- * When the `` --enable-experimental-jit `` option is used , the optimized
912
+ * When the JIT is enabled , the optimized
913
913
Tier 2 IR is translated to machine code, which is then executed.
914
- This does not require additional runtime options.
915
914
916
915
* The machine code translation process uses an architecture called
917
916
*copy-and-patch *. It has no runtime dependencies, but there is a new
918
917
build-time dependency on LLVM.
919
918
919
+ The ``--enable-experimental-jit `` flag has the following optional values:
920
+
921
+ * ``no `` (default) -- Disable the entire Tier 2 and JIT pipeline.
922
+
923
+ * ``yes `` (default if the flag is present without optional value)
924
+ -- Enable the JIT. To disable the JIT at runtime,
925
+ pass the environment variable ``PYTHON_JIT=0 ``.
926
+
927
+ * ``yes-default-off `` -- Build the JIT but disable it by default.
928
+ To emable the JIT at runtime, pass the environment variable
929
+ ``PYTHON_JIT=1 ``.
930
+
931
+ * ``interpreter `` -- Enable the Tier 2 interpreter but disable the JIT.
932
+ The interpreter can be disabled by running with
933
+ ``PYTHON_JIT=0 ``.
934
+
935
+ (On Windows, use ``PCbuild/build.bat --enable-jit `` to enable the JIT.)
936
+
920
937
See :pep: `744 ` for more details.
921
938
922
939
(JIT by Brandt Bucher, inspired by a paper by Haoran Xu and Fredrik Kjolstad.
0 commit comments