diff options
author | Mark Shannon <mark@hotpy.org> | 2023-07-04 16:23:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-04 16:23:00 (GMT) |
commit | 318ea2c72e9aed7ac92457c28747eda9424c8327 (patch) | |
tree | 76e36a8bfdc7a6702b4fa5f4c7c34944efafc6d6 /Include | |
parent | 80f1c6c49b4cd2bf698eb2bc3d2f3da904880dd2 (diff) | |
download | cpython-318ea2c72e9aed7ac92457c28747eda9424c8327.zip cpython-318ea2c72e9aed7ac92457c28747eda9424c8327.tar.gz cpython-318ea2c72e9aed7ac92457c28747eda9424c8327.tar.bz2 |
GH-106360: Support very basic superblock introspection (#106422)
* Add len() and indexing support to uop superblocks.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cpython/optimizer.h | 2 | ||||
-rw-r--r-- | Include/internal/pycore_opcode.h | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/Include/cpython/optimizer.h b/Include/cpython/optimizer.h index 2664f5b..2260501 100644 --- a/Include/cpython/optimizer.h +++ b/Include/cpython/optimizer.h @@ -38,6 +38,8 @@ PyAPI_FUNC(void) PyUnstable_SetOptimizer(_PyOptimizerObject* optimizer); PyAPI_FUNC(_PyOptimizerObject *) PyUnstable_GetOptimizer(void); +PyAPI_FUNC(_PyExecutorObject *)PyUnstable_GetExecutor(PyCodeObject *code, int offset); + struct _PyInterpreterFrame * _PyOptimizer_BackEdge(struct _PyInterpreterFrame *frame, _Py_CODEUNIT *src, _Py_CODEUNIT *dest, PyObject **stack_pointer); diff --git a/Include/internal/pycore_opcode.h b/Include/internal/pycore_opcode.h index 428df4c..c7c2fdc 100644 --- a/Include/internal/pycore_opcode.h +++ b/Include/internal/pycore_opcode.h @@ -242,8 +242,11 @@ const uint8_t _PyOpcode_Deopt[256] = { }; #endif // NEED_OPCODE_TABLES -#ifdef Py_DEBUG -static const char *const _PyOpcode_OpName[268] = { + +extern const char *const _PyOpcode_OpName[268]; + +#ifdef NEED_OPCODE_TABLES +const char *const _PyOpcode_OpName[268] = { [CACHE] = "CACHE", [POP_TOP] = "POP_TOP", [PUSH_NULL] = "PUSH_NULL", @@ -513,7 +516,7 @@ static const char *const _PyOpcode_OpName[268] = { [STORE_FAST_MAYBE_NULL] = "STORE_FAST_MAYBE_NULL", [LOAD_CLOSURE] = "LOAD_CLOSURE", }; -#endif +#endif // NEED_OPCODE_TABLES #define EXTRA_CASES \ case 184: \ |