summaryrefslogtreecommitdiffstats
path: root/Include/cpython
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-01-10 15:44:34 (GMT)
committerGitHub <noreply@github.com>2024-01-10 15:44:34 (GMT)
commita0c9cf9456c2ee7a89d9bd859c07afac8cf5e893 (patch)
treed89d0bcbd8850e29b68a262c9427c6e5288d65f7 /Include/cpython
parent93930eaf0acd64dc0d08d58321d2682cb019bc1a (diff)
downloadcpython-a0c9cf9456c2ee7a89d9bd859c07afac8cf5e893.zip
cpython-a0c9cf9456c2ee7a89d9bd859c07afac8cf5e893.tar.gz
cpython-a0c9cf9456c2ee7a89d9bd859c07afac8cf5e893.tar.bz2
GH-113860: All executors are now defined in terms of micro ops. Convert counter executor to use uops. (GH-113864)
Diffstat (limited to 'Include/cpython')
-rw-r--r--Include/cpython/optimizer.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/Include/cpython/optimizer.h b/Include/cpython/optimizer.h
index d521eac..f077da7 100644
--- a/Include/cpython/optimizer.h
+++ b/Include/cpython/optimizer.h
@@ -31,8 +31,6 @@ typedef struct {
typedef struct _PyExecutorObject {
PyObject_VAR_HEAD
- /* WARNING: execute consumes a reference to self. This is necessary to allow executors to tail call into each other. */
- _Py_CODEUNIT *(*execute)(struct _PyExecutorObject *self, struct _PyInterpreterFrame *frame, PyObject **stack_pointer);
_PyVMData vm_data; /* Used by the VM, but opaque to the optimizer */
/* Data needed by the executor goes here, but is opaque to the VM */
} _PyExecutorObject;
@@ -52,6 +50,12 @@ typedef struct _PyOptimizerObject {
/* Data needed by the optimizer goes here, but is opaque to the VM */
} _PyOptimizerObject;
+/** Test support **/
+typedef struct {
+ _PyOptimizerObject base;
+ int64_t count;
+} _PyCounterOptimizerObject;
+
PyAPI_FUNC(int) PyUnstable_Replace_Executor(PyCodeObject *code, _Py_CODEUNIT *instr, _PyExecutorObject *executor);
PyAPI_FUNC(void) PyUnstable_SetOptimizer(_PyOptimizerObject* optimizer);