Skip to main content

JitContext

Struct JitContext 

Source
#[repr(C)]
pub struct JitContext {
Show 21 fields pub regs: [u64; 13], pub gas: i64, pub exit_reason: u32, pub exit_arg: u32, pub heap_base: u32, pub heap_top: u32, pub jt_ptr: *const u32, pub jt_len: u32, pub _pad0: u32, pub bb_starts: *const u8, pub bb_len: u32, pub _pad1: 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,
}
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; 13]

PVM registers (offset 0, 13 × 8 = 104 bytes).

§gas: i64

Gas counter (offset 104). Signed to detect underflow.

§exit_reason: u32

Exit reason code (offset 112).

§exit_arg: u32

Exit argument (offset 116) — host call ID, page fault addr, etc.

§heap_base: u32

Heap base address (offset 120).

§heap_top: u32

Current heap top (offset 124).

§jt_ptr: *const u32

Jump table pointer (offset 128).

§jt_len: u32

Jump table length (offset 136).

§_pad0: u32§bb_starts: *const u8

Basic block starts pointer (offset 144).

§bb_len: u32

Basic block starts length (offset 152).

§_pad1: u32§entry_pc: u32

Entry PC for re-entry after host calls (offset 160).

§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

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.