Skip to main content

RegionFn

Trait RegionFn 

Source
pub trait RegionFn: Send + Sync {
    // Required methods
    fn guard_set(&self) -> &[(u16, SlotKind)];
    fn free_set(&self) -> &[u16];
    fn write_set(&self) -> &[(u16, SlotKind)];
    fn frame_size(&self) -> usize;
    fn run(&self, frame: &mut [i64], depth: usize) -> RegionOutcome;

    // Provided methods
    fn array_set(&self) -> &[ArrayPin] { ... }
    fn hoist_guards(&self) -> &[HoistGuard] { ... }
    fn region_return(&self) -> Option<RegionReturn> { ... }
    fn arena_slots(&self) -> usize { ... }
    fn precise_kinds(&self, _resume_pc: usize) -> Option<&[Option<SlotKind>]> { ... }
}

Required Methods§

Source

fn guard_set(&self) -> &[(u16, SlotKind)]

Slots whose CURRENT values the region may read before writing (or must preserve across a conditional write): the VM guards each one’s kind and copies its raw representation into the native frame.

Source

fn free_set(&self) -> &[u16]

Slots whose incoming values are provably DEAD (written before read, e.g. the loop-condition scratch): no guard, no copy-in.

Source

fn write_set(&self) -> &[(u16, SlotKind)]

Slots the region writes, with their re-boxing kinds.

Source

fn frame_size(&self) -> usize

Source

fn run(&self, frame: &mut [i64], depth: usize) -> RegionOutcome

Provided Methods§

Source

fn array_set(&self) -> &[ArrayPin]

Arrays the region reads/writes through pinned buffers (see ArrayPin). Default: none.

Source

fn hoist_guards(&self) -> &[HoistGuard]

Hoisted region-entry bounds checks (see HoistGuard). Default: none.

Source

fn region_return(&self) -> Option<RegionReturn>

In-region Return support (see RegionReturn). Default: none — such regions bail.

Source

fn arena_slots(&self) -> usize

Extra arena headroom beyond frame_size (regions that CALL functions window their callees past the frame and need real call arena depth). Default: none.

Source

fn precise_kinds(&self, _resume_pc: usize) -> Option<&[Option<SlotKind>]>

PRECISE-deopt re-box kinds at resume_pc: one entry per VM register — Some(kind) re-boxes the frame slot’s raw bits, None keeps the VM register’s current value (a pinned array, or a read-only/unknown slot). None overall ⇒ this region does not use precise deopt. Only meaningful for a RegionOutcome::DeoptAt { resume_pc } outcome.

Implementors§