Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-119786: Add jit.md. Move adaptive.md to a section of interpreter.md.#127175

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

Merged
iritkatriel merged 13 commits intopython:mainfromiritkatriel:adaptive
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
13 commits
Select commitHold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
mike's comments
  • Loading branch information
@iritkatriel
iritkatriel committedDec 5, 2024
commitc4b288b2a4be7640058c698cacdb99bef690a16f
10 changes: 5 additions & 5 deletionsInternalDocs/code_objects.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,11 +18,11 @@ Code objects are typically produced by the bytecode [compiler](compiler.md),
although they are often written to disk by one process and read back in by another.
The disk version of a code object is serialized using the
[marshal](https://docs.python.org/dev/library/marshal.html) protocol.
When a[`CodeObject`](code_objects.md) is created, the function
`_PyCode_Quicken()` from[`Python/specialize.c`](../Python/specialize.c) is
called to initializethe caches of all adaptive instructions. This is
required because theon-disk format is a sequence of bytes, and
some of the caches need to beinitialized with 16-bit values.
When a `CodeObject` is created, the function `_PyCode_Quicken()` from
[`Python/specialize.c`](../Python/specialize.c) is called to initialize
the caches of all adaptive instructions. This is required because the
on-disk format is a sequence of bytes, and some of the caches need to be
initialized with 16-bit values.

Code objects are nominally immutable.
Some fields (including `co_code_adaptive` and fields for runtime
Expand Down
2 changes: 1 addition & 1 deletionInternalDocs/interpreter.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -366,7 +366,7 @@ assumptions still apply, and de-optimizing back to the generic version if not.
## Families of instructions

A *family* of instructions consists of an adaptive instruction along with the
specializedinstruction that it can be replaced by.
specializedinstructions that it can be replaced by.
It has the following fundamental properties:

* It corresponds to a single instruction in the code
Expand Down
8 changes: 4 additions & 4 deletionsInternalDocs/jit.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,7 +86,7 @@ have changed.
When the full jit is enabled (python was configured with
[`--enable-experimental-jit`](https://docs.python.org/dev/using/configure.html#cmdoption-enable-experimental-jit),
the uop executor's `jit_code` field is populated with a pointer to a compiled
C function thatimplement the executor logic. This function's signature is
C function thatimplements the executor logic. This function's signature is
defined by `jit_func` in [`pycore_jit.h`](Include/internal/pycore_jit.h).
When the executor is invoked by `ENTER_EXECUTOR`, instead of jumping to
the uop interpreter at `tier2_dispatch`, the executor runs the function
Expand All@@ -101,16 +101,16 @@ of the micro ops, which are completed with runtime information while
the jitted code is constructed for an executor by
[`_PyJIT_Compile`](../Python/jit.c).

The stencils are generated under thebuild target `regen-jit` by the scripts
in [`/Tools/jit`](/Tools/jit). This script reads
The stencils are generatedat build timeunder theMakefile target `regen-jit`
by the scriptsin [`/Tools/jit`](/Tools/jit). This script reads
[`Python/executor_cases.c.h`](../Python/executor_cases.c.h) (which is
generated from [`Python/bytecodes.c`](../Python/bytecodes.c)). For
each opcode, it constructs a `.c` file that contains a function for
implementing this opcode, with some runtime information injected.
This is done by replacing `CASE` by the bytecode definition in the
template file [`Tools/jit/template.c`](../Tools/jit/template.c).

Each of the `.c`file is compiled by LLVM, to produce an object file
Each of the `.c`files is compiled by LLVM, to produce an object file
that contains a function that executes the opcode. These compiled
functions are used to generate the file
[`jit_stencils.h`](../jit_stencils.h), which contains the functions
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp