mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
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()
This commit is contained in:
parent
9e45fd9858
commit
9e4a81f00f
18 changed files with 212 additions and 227 deletions
|
|
@ -5,10 +5,11 @@
|
|||
#include "Python.h"
|
||||
#include "compile.h"
|
||||
#include "opcode.h"
|
||||
#include "internal/pycore_ceval.h"
|
||||
#include "internal/pycore_code.h"
|
||||
#include "internal/pycore_compile.h"
|
||||
#include "internal/pycore_intrinsics.h"
|
||||
#include "pycore_ceval.h"
|
||||
#include "pycore_code.h"
|
||||
#include "pycore_compile.h"
|
||||
#include "pycore_intrinsics.h"
|
||||
#include "pycore_optimizer.h" // _Py_GetExecutor()
|
||||
|
||||
/*[clinic input]
|
||||
module _opcode
|
||||
|
|
@ -395,7 +396,7 @@ _opcode_get_executor_impl(PyObject *module, PyObject *code, int offset)
|
|||
return NULL;
|
||||
}
|
||||
#ifdef _Py_TIER2
|
||||
return (PyObject *)PyUnstable_GetExecutor((PyCodeObject *)code, offset);
|
||||
return (PyObject *)_Py_GetExecutor((PyCodeObject *)code, offset);
|
||||
#else
|
||||
PyErr_Format(PyExc_RuntimeError,
|
||||
"Executors are not available in this build");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue