Expand description
Kernel-internal call stack.
Per v3 spec §3 “The Instance status state machine and kernel call stack”:
-
InstanceEntry — pushed by CALL. Introduces a fresh invocation of an Instance. Carries that invocation’s PC, regs, and reference to the in-flight Instance state.
-
ReferenceEntry — pushed by host_yield. Refers to an InstanceEntry earlier in the stack; the referenced entry’s PC and regs are shared (the ReferenceEntry is just a “this position also depends on entry N” pointer for yield-resume routing).
Invariants (enforced via enforce_invariants in debug builds):
- Exactly one entry is
Running— the top of the stack. - All others are
Waiting. - A
ReferenceEntryat positionihastarget_position < iand the target is anInstanceEntry.
State storage: an InstanceEntry owns its in-flight working root
cnode and references into a shared CacheDirectory for the underlying
Image and Instance content. The Vm consults the stack top to find
the actively executing Instance; it consults lower entries during
yield-marker routing.
Structs§
- Call
Stack - The kernel-internal call stack.
- Instance
Entry - In-flight state of an Instance currently on the call stack.
- Reference
Entry - Stack entry that refers to an InstanceEntry earlier on the stack.
Pushed by
host_yieldafter a yield marker matches the target’s YieldCatcher; the target resumes when this entry rotates to the top (via CALL_RESUME or HALT-unwind).
Enums§
- Entry
- One slot on the call stack.
- Entry
Status - Status of a stack entry. Exactly one entry is
Running(the top); all others areWaiting. Block-end faults any remainingWaitingentries per spec §3.
Constants§
- DEFAULT_
MAX_ DEPTH - Per the spec §18 default; the chain spec may override.