Skip to main content

JitContext

Struct JitContext 

Source
#[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: i64

Gas counter. Signed to detect underflow.

§exit_reason: u32

Exit reason code.

§exit_arg: u32

Exit argument — host call ID, page fault addr, etc.

§heap_base: u32

Heap base address.

§heap_top: u32

Current heap top.

§entry_pc: u32

Entry PC for re-entry after host calls.

§pc: u32

Current PC when execution stopped (offset 164).

§dispatch_table: *const i32

Dispatch table: PVM PC → native code offset (offset 168).

§code_base: u64

Base address of native code (offset 176).

§flat_buf: *mut u8

Flat guest memory buffer base pointer (offset 184).

§fast_reentry: u32

Fast re-entry flag.

§_pad2: u32§max_heap_pages: u32

Maximum heap pages — grow_heap refuses beyond this.

§_pad3: u32§host_rsp_base: u64

RSP 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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.