pub struct FnBytecode {
pub code: Vec<Op>,
pub constants: Vec<Constant>,
pub register_count: usize,
pub param_count: u16,
pub param_kinds: Vec<Option<ParamKind>>,
pub ret_kind: Option<SlotKind>,
pub named_regs: Vec<bool>,
}Expand description
One function lifted out of a CompiledProgram: a self-contained, relocatable
body with 0-relative jump targets plus the metadata to execute or compile it.
Fields§
§code: Vec<Op>The function body, with every jump target rebased to be relative to code[0].
constants: Vec<Constant>The constant pool the code indexes into — the program’s pool, copied so the unit is self-contained; constant indices are preserved unchanged.
register_count: usize§param_count: u16§param_kinds: Vec<Option<ParamKind>>§ret_kind: Option<SlotKind>§named_regs: Vec<bool>Which frame registers carry a user-visible name (the region JIT’s observability map; preserved from the source function).
Implementations§
Source§impl FnBytecode
impl FnBytecode
Sourcepub fn is_well_formed(&self, n_funcs: usize) -> bool
pub fn is_well_formed(&self, n_funcs: usize) -> bool
Structural self-consistency check (HOTSWAP §P12/P11 robustness). Every jump target
must land inside the body and the body must end in a control-leaving op, so an
installed body can neither fetch past the warm buffer (panic) nor fall through into
the next installed body (silent miscompile). A slice_function body always passes;
this rejects a corrupt / foreign / mis-decoded body so the VM declines the install
and falls back to baseline instead of trusting it. n_funcs bounds any Call
target so a body can’t dispatch to a non-existent function index.
Trait Implementations§
Source§impl Clone for FnBytecode
impl Clone for FnBytecode
Source§fn clone(&self) -> FnBytecode
fn clone(&self) -> FnBytecode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FnBytecode
impl Debug for FnBytecode
Source§impl<'de> Deserialize<'de> for FnBytecode
impl<'de> Deserialize<'de> for FnBytecode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for FnBytecode
impl RefUnwindSafe for FnBytecode
impl Send for FnBytecode
impl Sync for FnBytecode
impl Unpin for FnBytecode
impl UnsafeUnpin for FnBytecode
impl UnwindSafe for FnBytecode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.