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: StringExported C ABI symbol name (chosen by the caller; the emitter renames the JIT-side default to this).
entry_arity: usizeNumber 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: EmittedEntryShapeWhich 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: u32Fixed-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: u32Fixed-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: boolWhether 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: booltrue 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
impl Clone for EmitObjectInfo
Source§fn clone(&self) -> EmitObjectInfo
fn clone(&self) -> EmitObjectInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for EmitObjectInfo
impl RefUnwindSafe for EmitObjectInfo
impl Send for EmitObjectInfo
impl Sync for EmitObjectInfo
impl Unpin for EmitObjectInfo
impl UnsafeUnpin for EmitObjectInfo
impl UnwindSafe for EmitObjectInfo
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> 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