diff options
| author | Mark Shannon <mark@hotpy.org> | 2023-08-31 10:34:52 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-31 10:34:52 (GMT) |
| commit | 059bd4d299b384d2b434ccb106f91cb4bb03bbb1 (patch) | |
| tree | 0d5dfb60b2d62ebbca1a13788fc2ca64d457354c /Python/ceval_macros.h | |
| parent | 194c6fb85e02ecbb1eedb26601e9d503c4d25174 (diff) | |
| download | cpython-059bd4d299b384d2b434ccb106f91cb4bb03bbb1.zip cpython-059bd4d299b384d2b434ccb106f91cb4bb03bbb1.tar.gz cpython-059bd4d299b384d2b434ccb106f91cb4bb03bbb1.tar.bz2 | |
GH-108614: Remove non-debug uses of `#if TIER_ONE` and `#if TIER_TWO` from `_POP_FRAME` op. (GH-108685)
Diffstat (limited to 'Python/ceval_macros.h')
| -rw-r--r-- | Python/ceval_macros.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h index 635b8e5..4b7c444 100644 --- a/Python/ceval_macros.h +++ b/Python/ceval_macros.h @@ -373,3 +373,39 @@ static inline int _Py_EnterRecursivePy(PyThreadState *tstate) { static inline void _Py_LeaveRecursiveCallPy(PyThreadState *tstate) { tstate->py_recursion_remaining++; } + + +/* Implementation of "macros" that modify the instruction pointer, + * stack pointer, or frame pointer. + * These need to treated differently by tier 1 and 2. */ + +#if TIER_ONE + +#define LOAD_IP() \ +do { next_instr = frame->prev_instr+1; } while (0) + +#define STORE_SP() \ +_PyFrame_SetStackPointer(frame, stack_pointer) + +#define LOAD_SP() \ +stack_pointer = _PyFrame_GetStackPointer(frame); + +#endif + + +#if TIER_TWO + +#define LOAD_IP() \ +do { ip_offset = (_Py_CODEUNIT *)_PyFrame_GetCode(frame)->co_code_adaptive; } while (0) + +#define STORE_SP() \ +_PyFrame_SetStackPointer(frame, stack_pointer) + +#define LOAD_SP() \ +stack_pointer = _PyFrame_GetStackPointer(frame); + +#endif + + + + |
