#[repr(C)]pub struct JitContext {Show 16 fields
pub regs: [u64; 15],
pub gas: i64,
pub exit_reason: u32,
pub exit_arg: u32,
pub heap_base: u32,
pub heap_top: u32,
pub entry_pc: u32,
pub pc: u32,
pub dispatch_table: *const i32,
pub code_base: u64,
pub flat_buf: *mut u8,
pub fast_reentry: u32,
pub _pad2: u32,
pub max_heap_pages: u32,
pub _pad3: u32,
pub host_rsp_base: u64,
}Expand description
JIT execution context passed to compiled code via R15.
Must be #[repr(C)] with exact field ordering matching the
CTX_* offset constants in codegen.
Fields§
§regs: [u64; 15]PVM2 registers (offset 0, 15 × 8 = 120 bytes). Slots 0..12 are the
host-mapped GPRs (flushed to/from x86 registers at the prologue /
epilogue); slots 13/14 are the spilled x3/x4, which live here in
memory for the whole block and are materialised per access.
gas: i64Gas counter. Signed to detect underflow.
exit_reason: u32Exit reason code.
exit_arg: u32Exit argument — host call ID, page fault addr, etc.
heap_base: u32Heap base address.
heap_top: u32Current heap top.
entry_pc: u32Entry PC for re-entry after host calls.
pc: u32Current PC when execution stopped (offset 164).
dispatch_table: *const i32Dispatch table: PVM PC → native code offset (offset 168).
code_base: u64Base address of native code (offset 176).
flat_buf: *mut u8Flat guest memory buffer base pointer (offset 184).
fast_reentry: u32Fast re-entry flag.
_pad2: u32§max_heap_pages: u32Maximum heap pages — grow_heap refuses beyond this.
_pad3: u32§host_rsp_base: u64RSP saved at JIT entry (after the prologue’s callee-saved pushes but before any guest code runs). The exit_label restores RSP from this slot before popping the callee-saved registers, so an OOG / page-fault redirect taken mid-sequence leaves the exit path with a clean stack.