pub struct MixedFunctionTable { /* private fields */ }Expand description
Mixed function table mapping function IDs to either native or interpreted entries.
Supports lookup by both numeric index (for the flat instruction array) and content hash (for the content-addressed blob store).
Implementations§
Source§impl MixedFunctionTable
impl MixedFunctionTable
pub fn new() -> Self
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Pre-allocate space for capacity function entries.
Sourcepub fn insert(&mut self, id: usize, entry: FunctionEntry)
pub fn insert(&mut self, id: usize, entry: FunctionEntry)
Insert or replace an entry at the given index.
If id is beyond the current length, intermediate slots are filled
with Interpreted(0) placeholders.
Sourcepub fn get(&self, id: usize) -> Option<&FunctionEntry>
pub fn get(&self, id: usize) -> Option<&FunctionEntry>
Look up an entry by numeric function index.
Sourcepub fn insert_by_hash(&mut self, hash: FunctionHash, entry: FunctionEntry)
pub fn insert_by_hash(&mut self, hash: FunctionHash, entry: FunctionEntry)
Insert an entry keyed by content hash, also storing it at the given index.
Sourcepub fn get_by_hash(&self, hash: &FunctionHash) -> Option<&FunctionEntry>
pub fn get_by_hash(&self, hash: &FunctionHash) -> Option<&FunctionEntry>
Look up an entry by content hash.
Sourcepub fn native_count(&self) -> usize
pub fn native_count(&self) -> usize
Count of entries that are JIT-compiled native code.
Sourcepub fn interpreted_count(&self) -> usize
pub fn interpreted_count(&self) -> usize
Count of entries that fall back to the VM interpreter.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Count of entries that are awaiting background compilation.
Sourcepub fn iter(&self) -> impl Iterator<Item = (usize, &FunctionEntry)>
pub fn iter(&self) -> impl Iterator<Item = (usize, &FunctionEntry)>
Iterate over all entries with their index.
Sourcepub fn promote_to_native(&mut self, id: usize, ptr: *const u8)
pub fn promote_to_native(&mut self, id: usize, ptr: *const u8)
Promote a pending entry to native after background compilation completes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MixedFunctionTable
impl RefUnwindSafe for MixedFunctionTable
impl Send for MixedFunctionTable
impl !Sync for MixedFunctionTable
impl Unpin for MixedFunctionTable
impl UnsafeUnpin for MixedFunctionTable
impl UnwindSafe for MixedFunctionTable
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> 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