Skip to content

Commit bc8a50b

Browse files
committed
interpreter jit is for debugging
1 parent aced06a commit bc8a50b

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

InternalDocs/jit.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,24 @@ and an instance of `_PyUOpExecutor_Type` is created to contain it.
5959
After a `JUMP_BACKWARD` instruction invokes the uop optimizer to create a uop
6060
executor, it transfers control to this executor via the `GOTO_TIER_TWO` macro.
6161

62-
When the JIT is configured to run on its interpreter (i.e., python is
63-
configured with
64-
[`--enable-experimental-jit=interpreter`](https://docs.python.org/dev/using/configure.html#cmdoption-enable-experimental-jit)),
65-
the executor jumps to `tier2_dispatch:` in
62+
CPython implements two executors. Here we describe the JIT interpreter,
63+
which is the simpler of them and is therefore useful for debugging and analyzing
64+
the uops generation and optimization stages. To run it, we configure the
65+
JIT to run on its interpreter (i.e., python is configured with
66+
[`--enable-experimental-jit=interpreter`](https://docs.python.org/dev/using/configure.html#cmdoption-enable-experimental-jit)).
67+
68+
When invoked, the executor jumps to the `tier2_dispatch:` label in
6669
[`Python/ceval.c`](../Python/ceval.c), where there is a loop that
67-
executes the micro-ops. The micro-ops are are defined in
68-
[`Python/executor_cases.c.h`](../Python/executor_cases.c.h),
70+
executes the micro-ops. The body of this loop is a switch statement over
71+
the uops IDs, reselmbling the one used in the adaptive interpreter.
72+
73+
The swtich implementing the uops is in [`Python/executor_cases.c.h`](../Python/executor_cases.c.h),
6974
which is generated by the build script
7075
[`Tools/cases_generator/tier2_generator.py`](../Tools/cases_generator/tier2_generator.py)
7176
from the bytecode definitions in
7277
[`Python/bytecodes.c`](../Python/bytecodes.c).
73-
This loop exits when an `_EXIT_TRACE` or `_DEOPT` uop is reached,
78+
79+
When an `_EXIT_TRACE` or `_DEOPT` uop is reached, the uop interpreter exits
7480
and execution returns to the adaptive interpreter.
7581

7682
## Invalidating Executors

0 commit comments

Comments
 (0)