]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-120642: Move private PyCode APIs to the internal C API (#120643) (#121043)
authorVictor Stinner <vstinner@python.org>
Wed, 26 Jun 2024 13:35:19 +0000 (15:35 +0200)
committerGitHub <noreply@github.com>
Wed, 26 Jun 2024 13:35:19 +0000 (15:35 +0200)
commite26e0985d94f1b9812cf41f043df89185f247945
tree822ec897f9914e88f83e7d2821bcb0d45ce2a275
parent6bc7e2cca546c11e2b807068a4a612d0d902da11
[3.13] gh-120642: Move private PyCode APIs to the internal C API (#120643) (#121043)

gh-120642: Move private PyCode APIs to the internal C API (#120643)

* Move _Py_CODEUNIT and related functions to pycore_code.h.
* Move _Py_BackoffCounter to pycore_backoff.h.
* Move Include/cpython/optimizer.h content to pycore_optimizer.h.
* Remove Include/cpython/optimizer.h.
* Remove PyUnstable_Replace_Executor().

Rename functions:

* PyUnstable_GetExecutor() => _Py_GetExecutor()
* PyUnstable_GetOptimizer() => _Py_GetOptimizer()
* PyUnstable_SetOptimizer() => _Py_SetTier2Optimizer()
* PyUnstable_Optimizer_NewCounter() => _PyOptimizer_NewCounter()
* PyUnstable_Optimizer_NewUOpOptimizer() => _PyOptimizer_NewUOpOptimizer()

(cherry picked from commit 9e4a81f00fef689c6e18a64245aa064eaadc7ac7)
18 files changed:
Include/Python.h
Include/cpython/code.h
Include/cpython/optimizer.h [deleted file]
Include/internal/pycore_backoff.h
Include/internal/pycore_code.h
Include/internal/pycore_interp.h
Include/internal/pycore_optimizer.h
Makefile.pre.in
Misc/NEWS.d/next/C API/2024-06-19-21-27-42.gh-issue-120642.UlKClN.rst [new file with mode: 0644]
Misc/NEWS.d/next/C API/2024-06-26-11-29-01.gh-issue-120642.H7P9qK.rst [new file with mode: 0644]
Modules/_opcode.c
Modules/_testinternalcapi.c
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
Python/optimizer.c
Python/optimizer_analysis.c
Python/optimizer_symbols.c
Python/pylifecycle.c