mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
GH-108716: Turn off deep-freezing of code objects. (GH-108722)
This commit is contained in:
parent
00cf626cd4
commit
15d4c9fabc
15 changed files with 50 additions and 86 deletions
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include "Python.h"
|
||||
#include "pycore_ceval.h" // _PyEval_BuiltinsFromGlobals()
|
||||
#include "pycore_code.h" // _Py_next_func_version
|
||||
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
|
||||
#include "pycore_pyerrors.h" // _PyErr_Occurred()
|
||||
|
||||
|
@ -252,11 +251,9 @@ When the function version is 0, the `CALL` bytecode is not specialized.
|
|||
Code object versions
|
||||
--------------------
|
||||
|
||||
So where to code objects get their `co_version`? There is a single
|
||||
static global counter, `_Py_next_func_version`. This is initialized in
|
||||
the generated (!) file `Python/deepfreeze/deepfreeze.c`, to 1 plus the
|
||||
number of deep-frozen function objects in that file.
|
||||
(In `_bootstrap_python.c` and `freeze_module.c` it is initialized to 1.)
|
||||
So where to code objects get their `co_version`?
|
||||
There is a per-interpreter counter, `next_func_version`.
|
||||
This is initialized to 1 when the interpreter is created.
|
||||
|
||||
Code objects get a new `co_version` allocated from this counter upon
|
||||
creation. Since code objects are nominally immutable, `co_version` can
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue