Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
gh-118335: Configure Tier 2 interpreter at build time#118339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
1eb8fea0863c179e43331064de5813b8ef0edbaeef9311198300ae6ddb911e48cb71dd7e79509638b7ec8fc905f877a005e4464d4ffd77226e2777bf228a0670e18a517f1674e23c688ebd8025e367c2786818138f89b3bfe942202963ccb783c3ccf45f7ca391bd46c5d8c0af45bf67a6cc5ee35cb5bd8276a9af950e256be70c0fdbe4403c919bbd5a3ff007c485ea2d4f30File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -888,7 +888,7 @@ Experimental JIT Compiler | ||
| ========================= | ||
| When CPython is configured using the ``--enable-experimental-jit`` option, | ||
| a just-in-time compiler is added whichmay speed up some Python programs. | ||
| The internal architecture is roughly as follows. | ||
| @@ -905,19 +905,35 @@ The internal architecture is roughly as follows. | ||
| before it is interpreted or translated to machine code. | ||
| * There is a Tier 2 interpreter, but it is mostly intended for debugging | ||
| the earlier stages of the optimization pipeline. | ||
| The Tier 2 interpreter can be enabled by configuring Python | ||
| with ``--enable-experimental-jit=interpreter``. | ||
| * When theJITisenabled, the optimized | ||
| Tier 2 IR is translated to machine code, which is then executed. | ||
| * The machine code translation process uses an architecture called | ||
| *copy-and-patch*. It has no runtime dependencies, but there is a new | ||
| build-time dependency on LLVM. | ||
| The ``--enable-experimental-jit`` flag has the following optional values: | ||
| * ``no`` (default) -- Disable the entire Tier 2 and JIT pipeline. | ||
| * ``yes`` (default if the flag is present without optional value) | ||
| -- Enable the JIT. To disable the JIT at runtime, | ||
| pass the environment variable ``PYTHON_JIT=0``. | ||
| * ``yes-off`` -- Build the JIT but disable it by default. | ||
| To enable the JIT at runtime, pass the environment variable | ||
| ``PYTHON_JIT=1``. | ||
| * ``interpreter`` -- Enable the Tier 2 interpreter but disable the JIT. | ||
| The interpreter can be disabled by running with | ||
| ``PYTHON_JIT=0``. | ||
| (On Windows, use ``PCbuild/build.bat --enable-jit`` to enable the JIT.) | ||
brandtbucher marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| See :pep:`744` for more details. | ||
| (JIT by Brandt Bucher, inspired by a paper by Haoran Xu and Fredrik Kjolstad. | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Change how to use the tier 2 interpreter. Instead of running Python with | ||
| ``-X uops`` or setting the environment variable ``PYTHON_UOPS=1``, this | ||
| choice is now made at build time by configuring with | ||
| ``--enable-experimental-jit=interpreter``. |
Uh oh!
There was an error while loading.Please reload this page.