GH-113860: Get rid of _PyUOpExecutorObject (GH-113954)

This commit is contained in:
Brandt Bucher 2024-01-12 03:58:23 -08:00 committed by GitHub
parent 29e2839cd6
commit 30e6cbdba2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 35 additions and 67 deletions

View file

@ -29,10 +29,17 @@ typedef struct {
_PyExecutorLinkListNode links;
} _PyVMData;
typedef struct {
uint16_t opcode;
uint16_t oparg;
uint32_t target;
uint64_t operand; // A cache entry
} _PyUOpInstruction;
typedef struct _PyExecutorObject {
PyObject_VAR_HEAD
_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 */
_PyUOpInstruction trace[1];
} _PyExecutorObject;
typedef struct _PyOptimizerObject _PyOptimizerObject;

View file

@ -8,8 +8,6 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif
#include "pycore_uops.h" // _PyUOpInstruction
int _Py_uop_analyze_and_optimize(PyCodeObject *code,
_PyUOpInstruction *trace, int trace_len, int curr_stackentries);

View file

@ -1,30 +0,0 @@
#ifndef Py_INTERNAL_UOPS_H
#define Py_INTERNAL_UOPS_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif
#include "pycore_frame.h" // _PyInterpreterFrame
#define _Py_UOP_MAX_TRACE_LENGTH 512
typedef struct {
uint16_t opcode;
uint16_t oparg;
uint32_t target;
uint64_t operand; // A cache entry
} _PyUOpInstruction;
typedef struct {
_PyExecutorObject base;
_PyUOpInstruction trace[1];
} _PyUOpExecutorObject;
#ifdef __cplusplus
}
#endif
#endif /* !Py_INTERNAL_UOPS_H */