diff options
| author | Mark Shannon <mark@hotpy.org> | 2023-04-12 11:04:55 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-12 11:04:55 (GMT) |
| commit | 411b1692811b2ecac59cb0df0f920861c7cf179a (patch) | |
| tree | 64f7234e9d35623565ff1bb7fbd2c4688e8d3774 /Include/internal/pycore_code.h | |
| parent | dce2d38cb04b541bad477ccc1040a68fa70a9a69 (diff) | |
| download | cpython-411b1692811b2ecac59cb0df0f920861c7cf179a.zip cpython-411b1692811b2ecac59cb0df0f920861c7cf179a.tar.gz cpython-411b1692811b2ecac59cb0df0f920861c7cf179a.tar.bz2 | |
GH-103082: Implementation of PEP 669: Low Impact Monitoring for CPython (GH-103083)
* The majority of the monitoring code is in instrumentation.c
* The new instrumentation bytecodes are in bytecodes.c
* legacy_tracing.c adapts the new API to the old sys.setrace and sys.setprofile APIs
Diffstat (limited to 'Include/internal/pycore_code.h')
| -rw-r--r-- | Include/internal/pycore_code.h | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h index faf1be5..d32f37a 100644 --- a/Include/internal/pycore_code.h +++ b/Include/internal/pycore_code.h @@ -441,32 +441,6 @@ adaptive_counter_backoff(uint16_t counter) { /* Line array cache for tracing */ -extern int _PyCode_CreateLineArray(PyCodeObject *co); - -static inline int -_PyCode_InitLineArray(PyCodeObject *co) -{ - if (co->_co_linearray) { - return 0; - } - return _PyCode_CreateLineArray(co); -} - -static inline int -_PyCode_LineNumberFromArray(PyCodeObject *co, int index) -{ - assert(co->_co_linearray != NULL); - assert(index >= 0); - assert(index < Py_SIZE(co)); - if (co->_co_linearray_entry_size == 2) { - return ((int16_t *)co->_co_linearray)[index]; - } - else { - assert(co->_co_linearray_entry_size == 4); - return ((int32_t *)co->_co_linearray)[index]; - } -} - typedef struct _PyShimCodeDef { const uint8_t *code; int codelen; @@ -500,6 +474,10 @@ extern uint32_t _Py_next_func_version; #define COMPARISON_NOT_EQUALS (COMPARISON_UNORDERED | COMPARISON_LESS_THAN | COMPARISON_GREATER_THAN) +extern int _Py_Instrument(PyCodeObject *co, PyInterpreterState *interp); + +extern int _Py_GetBaseOpcode(PyCodeObject *code, int offset); + #ifdef __cplusplus } |
