-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Closed
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement
Description
In order to be able to flush the stack efficiently around escaping calls, the interpreter code generators need to be able to handle simple-ish flow control.
For example, in this code:
op(_CHECK_PERIODIC, (--)) {
if (_Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker) & _PY_EVAL_EVENTS_MASK) {
int err = _Py_HandlePending(tstate);
ERROR_IF(err != 0, error);
}
}
The general shape is:
if (cond) {
*escaping_call()*
}
We want to be able to track the flow control so that we can spill around the call, but not on the fast path:
if (cond) {
SPILL_STACK();
*escaping_call()*
RELOAD_STACK();
}
We cannot currently do this.
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement