Expand description
The RuntimeContext handed to every generated function (§10.3, Appendix B)
and the Runtime that owns the heap + immortals.
Every generated function receives a hidden first parameter — a pointer to
RuntimeContext — followed only by GcRef arguments, and returns one
GcRef. The context is the single channel through which generated code
reaches the GC heap, the pending fault, the debug frame chain, the input
source, and so on.
Structs§
- Debug
Local - One local variable in a debug frame snapshot (§9.3).
- Fault
- The fault record a
RuntimeContextpoints at.pending_faultis non-null and points at the owning runtime’s slot. - Fault
Message - The message a
FaultKind::PanicorFaultKind::AssertFailedcarries. - Raised
Fault - A
FaultKindthat is actually a fault. - Runtime
- The owner of the heap and the immortal singletons.
- Runtime
Context - The hidden first argument to every generated function.
- Stack
Budget - A native-stack budget a
RuntimeContextmay be minted with: au32proven no larger thanSTACK_BUDGET_BYTESat construction.
Enums§
- Fault
Kind - What kind of runtime fault occurred (§9.2, §10.4). Set by the runtime wrapper that detected it; read by the host after the generated code unwinds to its fault epilogue.
Constants§
- FRAME_
BYTES_ BASE - What any call spends, however narrow: the floor of
frame_cost, in bytes (ADR-105). - FRAME_
BYTES_ PER_ SLOT - What each
Gclocal pastREFERENCE_FRAME_SLOTSadds to a frame’s cost, in bytes (ADR-105). Rounds up arm64’s measured 1.06 B per local; x86_64 measures no slope at all, andFRAME_BYTES_BASEsays why that left this constant where it was. - MAX_
RECURSION_ DEPTH - The deepest recursion a reference-width function reaches, and the figure
STACK_BUDGET_BYTESis derived from. - REFERENCE_
FRAME_ SLOTS - The frame width
MAX_RECURSION_DEPTHis calibrated against: theGclocal count of - STACK_
BUDGET_ BYTES - The native stack, in bytes, that Praxis frames may occupy — and the largest budget a host may install (ADR-105).
Functions§
- current_
fault_ ⚠kind - Read the current fault kind from a context’s
pending_faultslot (§9.2). ReturnsFaultKind::Noneif no fault is pending or the slot is null. Used bycrate::crash_snapshot::praxis_snapshot_debug_chainto record which fault kind triggered the snapshot. - frame_
cost - What one call spends of
StackBudget: a floor, plus a per-slot term for everyGclocal past the reference width (ADR-105).