Skip to main content

Module frame

Module frame 

Source

Structs§

FrameLocals
Lazy locals dict for frames. For NEWLOCALS frames, the dict is only allocated on first access (most function frames never need it).
FrameObject
InterpreterFrame
Lightweight execution frame. Not a PyObject. Analogous to CPython’s _PyInterpreterFrame.
LocalsPlus
Unified storage for local variables and evaluation stack.

Enums§

ExecutionResult

Functions§

current_builtins
Read the builtins object from the topmost frame on this thread’s chain.
current_code
Read the code object from the topmost frame on this thread’s chain. Returns None if the chain is empty.
current_globals
Read the globals dict from the topmost frame on this thread’s chain. Returns None if the chain is empty.
current_thread_frame
The current thread’s topmost frame object, if any.
current_thread_frame_materialize
The current thread’s topmost frame object, materializing if necessary. Unlike current_thread_frame(), this always returns Some if there is an active frame, even if it’s stack-allocated and hasn’t been observed yet. Uses vm.current_frame Cell for fast lookup (no TLS).
current_thread_iframe
Get the current thread’s topmost InterpreterFrame pointer.
find_owned_chain_frame
If target FrameObject is on the current thread’s chain, return an owned reference to it; otherwise None. Presence on the chain proves liveness.
find_owned_chain_frame_by_iframe
If a FrameObject wrapping target InterpreterFrame is on the current thread’s chain, return an owned reference to it; otherwise None.
for_each_current_frame
Invoke f for each frame on the current thread’s chain, from the topmost frame down to the bottom.
frame_at_offset
The frame offset positions below the current thread’s top frame (offset 0 is the top), or None if the stack is not that deep. Materializes the FrameObject on demand for stack-allocated frames.

Type Aliases§

FrameObjectRef