pub struct Function {Show 14 fields
pub name: String,
pub arity: u16,
pub param_names: Vec<String>,
pub locals_count: u16,
pub entry_point: usize,
pub body_length: usize,
pub is_closure: bool,
pub captures_count: u16,
pub is_async: bool,
pub ref_params: Vec<bool>,
pub ref_mutates: Vec<bool>,
pub mutable_captures: Vec<bool>,
pub frame_descriptor: Option<FrameDescriptor>,
pub osr_entry_points: Vec<OsrEntryPoint>,
}Expand description
Function definition in bytecode
Fields§
§name: String§arity: u16§param_names: Vec<String>§locals_count: u16§entry_point: usize§body_length: usize§is_closure: bool§captures_count: u16§is_async: bool§ref_params: Vec<bool>Which parameters are passed by reference (&).
ref_params[i] == true means param i is a reference.
ref_mutates: Vec<bool>Which reference parameters mutate their target.
ref_mutates[i] == true means ref param i performs writes (exclusive borrow).
false means read-only (shared borrow).
mutable_captures: Vec<bool>Which upvalues (captures) are mutable.
mutable_captures[i] == true means capture i is assigned inside the closure
and should use Mutable(Arc<RwLock<>>) upvalues for shared state.
frame_descriptor: Option<FrameDescriptor>Typed frame layout for this function’s locals (params + locals).
When present, the JIT / VM can use per-slot type information to
skip NaN-boxing and allocate native-width registers. None means
all slots are treated as generic Boxed values.
osr_entry_points: Vec<OsrEntryPoint>OSR (On-Stack Replacement) entry points for hot loops in this function.
Populated by loop analysis when the JIT compiles a loop body separately. Each entry describes a loop header where the VM can transfer execution from the interpreter into JIT-compiled code mid-function.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
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 Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnsafeUnpin for Function
impl UnwindSafe for Function
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more