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

This commit is contained in:
Irit Katriel 2024-12-06 16:36:06 +00:00 committed by GitHub
parent 67b18a18b6
commit 89fa7ec74e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 322 additions and 187 deletions

View file

@ -18,6 +18,11 @@ # Code objects
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` 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