mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
GH-132532: Add new DSL macros to better declare semantics of exits at ends of instructions/uops. (GH-137098)
This commit is contained in:
parent
c744b57fd6
commit
af15e1d13e
15 changed files with 524 additions and 609 deletions
38
Python/executor_cases.c.h
generated
38
Python/executor_cases.c.h
generated
|
|
@ -13,31 +13,25 @@
|
|||
}
|
||||
|
||||
case _CHECK_PERIODIC: {
|
||||
_Py_CHECK_EMSCRIPTEN_SIGNALS_PERIODICALLY();
|
||||
QSBR_QUIESCENT_STATE(tstate);
|
||||
if (_Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker) & _PY_EVAL_EVENTS_MASK) {
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
int err = _Py_HandlePending(tstate);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
if (err != 0) {
|
||||
JUMP_TO_ERROR();
|
||||
}
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
int err = check_periodics(tstate);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
if (err != 0) {
|
||||
JUMP_TO_ERROR();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* _CHECK_PERIODIC_AT_END is not a viable micro-op for tier 2 because it is replaced */
|
||||
|
||||
case _CHECK_PERIODIC_IF_NOT_YIELD_FROM: {
|
||||
oparg = CURRENT_OPARG();
|
||||
if ((oparg & RESUME_OPARG_LOCATION_MASK) < RESUME_AFTER_YIELD_FROM) {
|
||||
_Py_CHECK_EMSCRIPTEN_SIGNALS_PERIODICALLY();
|
||||
QSBR_QUIESCENT_STATE(tstate);
|
||||
if (_Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker) & _PY_EVAL_EVENTS_MASK) {
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
int err = _Py_HandlePending(tstate);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
if (err != 0) {
|
||||
JUMP_TO_ERROR();
|
||||
}
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
int err = check_periodics(tstate);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
if (err != 0) {
|
||||
JUMP_TO_ERROR();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -7443,6 +7437,14 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _HANDLE_PENDING_AND_DEOPT: {
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
int err = _Py_HandlePending(tstate);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
GOTO_TIER_ONE(err ? NULL : _PyFrame_GetBytecode(frame) + CURRENT_TARGET());
|
||||
break;
|
||||
}
|
||||
|
||||
case _ERROR_POP_N: {
|
||||
oparg = CURRENT_OPARG();
|
||||
uint32_t target = (uint32_t)CURRENT_OPERAND0();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue