]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-46841: Quicken code in-place (GH-31888)
authorBrandt Bucher <brandtbucher@microsoft.com>
Mon, 21 Mar 2022 11:11:17 +0000 (04:11 -0700)
committerGitHub <noreply@github.com>
Mon, 21 Mar 2022 11:11:17 +0000 (11:11 +0000)
commit2bde6827ea4f136297b2d882480b981ff26262b6
tree8ad0569c15e0f516eaf8547581c6de2ca702b349
parent08eb754d840696914928355014c2d424131f8835
bpo-46841: Quicken code in-place (GH-31888)

* Moves the bytecode to the end of the corresponding PyCodeObject, and quickens it in-place.

* Removes the almost-always-unused co_varnames, co_freevars, and co_cellvars member caches

* _PyOpcode_Deopt is a new mapping from all opcodes to their un-quickened forms.

* _PyOpcode_InlineCacheEntries is renamed to _PyOpcode_Caches

* _Py_IncrementCountAndMaybeQuicken is renamed to _PyCode_Warmup

* _Py_Quicken is renamed to _PyCode_Quicken

* _co_quickened is renamed to _co_code_adaptive (and is now a read-only memoryview).

* Do not emit unused nonzero opargs anymore in the compiler.
18 files changed:
Include/cpython/code.h
Include/internal/pycore_code.h
Include/opcode.h
Lib/opcode.py
Lib/test/test_compile.py
Misc/NEWS.d/next/Core and Builtins/2022-03-16-11-05-35.bpo-46841.yUoIHg.rst [new file with mode: 0644]
Objects/clinic/codeobject.c.h
Objects/codeobject.c
Objects/frameobject.c
Objects/genobject.c
Objects/typeobject.c
Python/ceval.c
Python/compile.c
Python/marshal.c
Python/opcode_targets.h
Python/specialize.c
Tools/scripts/deepfreeze.py
Tools/scripts/generate_opcode_h.py