You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we spill the evaluation stack for most escaping calls, but not all.
For a few calls, notably Py_DECREF, PyStackRef_CLOSE and related calls, the stack isn't spilled.
Spilling in those cases would add a fair bit of complexity to the code generator and might produce a small slowdown, but it is worth it.
Knowing that all values are in memory and visible during escaping calls allows us to be much less conservative
when handling reference counts. We can potentially defer many, many more references as the GC is guaranteed to
be able to find all references on the stack. The free-threading build can avoid having to NULL out the stack
as will only see the valid part of the stack.
There are also benefits unrelated to performance: debuggers and other tools can reliably see values on the stack,
providing more information that just local variables. For example, having the full stack visible during sys.monitoring INSTRUCTION events allows reversable debuggers to be implemented more simply.
The content you are editing has changed. Please copy your edits and refresh the page.
Currently, we spill the evaluation stack for most escaping calls, but not all.
For a few calls, notably
Py_DECREF
,PyStackRef_CLOSE
and related calls, the stack isn't spilled.Spilling in those cases would add a fair bit of complexity to the code generator and might produce a small slowdown, but it is worth it.
Knowing that all values are in memory and visible during escaping calls allows us to be much less conservative
when handling reference counts. We can potentially defer many, many more references as the GC is guaranteed to
be able to find all references on the stack. The free-threading build can avoid having to
NULL
out the stackas will only see the valid part of the stack.
There are also benefits unrelated to performance: debuggers and other tools can reliably see values on the stack,
providing more information that just local variables. For example, having the full stack visible during sys.monitoring
INSTRUCTION
events allows reversable debuggers to be implemented more simply.Tasks
Linked PRs
DEAD
andDECREF_INPUTS
#128683The text was updated successfully, but these errors were encountered: