#[repr(u32)]pub enum VtableSlot {
RelonStrContains = 0,
RelonCallNative = 1,
RelonF64ToStr = 2,
}Expand description
One slot per host helper the LLVM codegen indirects through, in the same order cranelift pins them in its data-vtable. Adding a new helper appends a variant (NEVER reorder existing variants).
| Slot | cranelift analogue | LLVM symbol |
|---|---|---|
| 0 | RelonGlobMatch (slot 3) | relon_llvm_str_contains_arena |
| 1 | RelonCallNative (slot 4) | relon_llvm_call_native |
| 2 | RelonF64ToStr (slot 5) | relon_llvm_f64_to_str |
cranelift’s slots 0..=2 (RelonNow / RelonRaiseTrap /
RelonCapLookup) have no LLVM counterpart: the LLVM gate is an
inline caps-bitmask test baked into the object by Op::CheckCap
(no cap_lookup helper), trap codes are written directly to
ArenaState::trap_code by the helper / trap arm (no raise_trap
helper), and the deadline clock (now) is reserved for the LLVM
deadline work. Only the two helpers the LLVM emitter actually
declares as externs are represented here.
Variants§
RelonStrContains = 0
extern "C" fn(s_ptr: *const u8, n_ptr: *const u8) -> i32.
Tier-2 substring matcher; the LLVM mirror of cranelift’s
RelonGlobMatch. Declared lazily on the first
Op::Call { contains } site.
RelonCallNative = 1
extern "C" fn(state: *const ArenaState, import_idx: u32, args_ptr: *const i64, arg_count: u32) -> i64. Dynamic host-fn
dispatch; the LLVM mirror of cranelift’s RelonCallNative. See
[crate::state::relon_llvm_call_native].
RelonF64ToStr = 2
extern "C" fn(bits: i64, dest: *mut u8) -> i32. Wave B float
Display renderer; the LLVM mirror of cranelift’s
RelonF64ToStr. Declared lazily on the first Op::FloatToStr
site. See crate::str_helpers::relon_llvm_f64_to_str.
Implementations§
Source§impl VtableSlot
impl VtableSlot
Sourcepub const COUNT: u32 = 3
pub const COUNT: u32 = 3
Number of slots the LLVM emitter can declare. Mirrors cranelift’s
VtableSlot::COUNT; bumping it needs a matching variant + a
populate_global_mappings arm.
Sourcepub const ALL: [VtableSlot; 3]
pub const ALL: [VtableSlot; 3]
All slots, in declaration order. Used by populate_global_mappings
and the parity tests.
Trait Implementations§
Source§impl Clone for VtableSlot
impl Clone for VtableSlot
Source§fn clone(&self) -> VtableSlot
fn clone(&self) -> VtableSlot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for VtableSlot
Source§impl Debug for VtableSlot
impl Debug for VtableSlot
impl Eq for VtableSlot
Source§impl PartialEq for VtableSlot
impl PartialEq for VtableSlot
Source§fn eq(&self, other: &VtableSlot) -> bool
fn eq(&self, other: &VtableSlot) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for VtableSlot
Auto Trait Implementations§
impl Freeze for VtableSlot
impl RefUnwindSafe for VtableSlot
impl Send for VtableSlot
impl Sync for VtableSlot
impl Unpin for VtableSlot
impl UnsafeUnpin for VtableSlot
impl UnwindSafe for VtableSlot
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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