mirror of
https://github.com/python/cpython.git
synced 2025-10-20 00:13:47 +00:00
GH-112354: Initial implementation of warm up on exits and trace-stitching (GH-114142)
This commit is contained in:
parent
acda1757bc
commit
7b21403ccd
29 changed files with 744 additions and 198 deletions
|
@ -394,7 +394,36 @@ stack_pointer = _PyFrame_GetStackPointer(frame);
|
|||
|
||||
/* Tier-switching macros. */
|
||||
|
||||
#define GOTO_TIER_TWO() goto enter_tier_two;
|
||||
#ifdef _Py_JIT
|
||||
#define GOTO_TIER_TWO(EXECUTOR) \
|
||||
do { \
|
||||
jit_func jitted = (EXECUTOR)->jit_code; \
|
||||
next_instr = jitted(frame, stack_pointer, tstate); \
|
||||
Py_DECREF(tstate->previous_executor); \
|
||||
tstate->previous_executor = NULL; \
|
||||
frame = tstate->current_frame; \
|
||||
if (next_instr == NULL) { \
|
||||
goto resume_with_error; \
|
||||
} \
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame); \
|
||||
DISPATCH(); \
|
||||
} while (0)
|
||||
#else
|
||||
#define GOTO_TIER_TWO(EXECUTOR) \
|
||||
do { \
|
||||
next_uop = (EXECUTOR)->trace; \
|
||||
assert(next_uop->opcode == _START_EXECUTOR || next_uop->opcode == _COLD_EXIT); \
|
||||
goto enter_tier_two; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#define GOTO_TIER_ONE(TARGET) \
|
||||
do { \
|
||||
Py_DECREF(tstate->previous_executor); \
|
||||
tstate->previous_executor = NULL; \
|
||||
next_instr = target; \
|
||||
DISPATCH(); \
|
||||
} while (0)
|
||||
|
||||
#define CURRENT_OPARG() (next_uop[-1].oparg)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue