Skip to main content

EmitObjectInfo

Struct EmitObjectInfo 

Source
pub struct EmitObjectInfo {
    pub entry_symbol: String,
    pub entry_arity: usize,
    pub param_names: Vec<String>,
    pub shape: EmittedEntryShape,
    pub main_fields: Vec<EmittedField>,
    pub return_fields: Vec<EmittedField>,
    pub main_root_size: u32,
    pub return_root_size: u32,
    pub return_has_tail: bool,
    pub const_data: Vec<u8>,
    pub references_str_contains_shim: bool,
}
Expand description

Metadata returned by LlvmAotEvaluator::emit_object so the build.rs caller can stamp matching extern "C" declarations and marshalling code into the generated Rust shim.

The shape carried by Self::shape decides the binding shape: fast-path entries get a thin extern "C" fn(i64, ...) -> i64 wrapper; buffer-protocol entries route through relon-rs-shims::call_buffer_entry with typed Rust args.

Fields§

§entry_symbol: String

Exported C ABI symbol name (chosen by the caller; the emitter renames the JIT-side default to this).

§entry_arity: usize

Number of declared #main parameters. For fast-path entries this equals the C ABI arity; for buffer-protocol entries the C ABI arity is always 6, while this field reports the user-visible #main arity.

§param_names: Vec<String>

Declared parameter names in #main(...) declaration order. Build.rs uses these to name the Rust shim’s args.

§shape: EmittedEntryShape

Which extern signature the emitted symbol carries. Drives the binding generator’s dispatch shape.

§main_fields: Vec<EmittedField>

Declared #main parameters with byte-offsets and type tags. Used by the buffer-protocol binding to pack input args into the arena. Empty under EmittedEntryShape::FastInt (the fast path reads args from positional registers, not the buffer).

§return_fields: Vec<EmittedField>

Return record fields. Phase 2 lowering always wraps the #main return in a single-field schema Ret { value: T }, so this vector has exactly one entry. Empty under EmittedEntryShape::FastInt.

§main_root_size: u32

Fixed-area byte size of the input record. The buffer-protocol binding allocates in_len = main_root_size + tail_len_for_strings bytes. Zero under EmittedEntryShape::FastInt.

§return_root_size: u32

Fixed-area byte size of the return record. The buffer-protocol binding reserves at least this much in the output region. Zero under EmittedEntryShape::FastInt.

§return_has_tail: bool

Whether the return schema contains pointer-indirect leaves (String / List*) — drives the binding’s tail-cap sizing.

§const_data: Vec<u8>

Const-pool blob the JIT body references through arena-relative i32 offsets (Op::ConstString records). The binding copies this verbatim to arena[..const_data.len()] before every dispatch. Empty under EmittedEntryShape::FastInt (the fast path doesn’t touch the const pool).

§references_str_contains_shim: bool

true when the emitted body references a host shim that lives in the relon-rs-shims staticlib (relon_llvm_str_contains_arena or Wave B’s relon_llvm_f64_to_str). Build.rs uses this to decide whether to add that staticlib to the linker invocation. The historical name predates the second shim; semantically it means “needs the rs-shims staticlib”.

Trait Implementations§

Source§

impl Clone for EmitObjectInfo

Source§

fn clone(&self) -> EmitObjectInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EmitObjectInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.