GH-108614: Remove non-debug uses of #if TIER_ONE and #if TIER_TWO from _POP_FRAME op. (GH-108685)

This commit is contained in:
Mark Shannon 2023-08-31 11:34:52 +01:00 committed by GitHub
parent 194c6fb85e
commit 059bd4d299
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 123 additions and 66 deletions

View file

@ -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