Expand description
AOT-native tier loader (HOTSWAP §Axis-3 / P15): dlopen a rustc-built cdylib
(produced by crate::compile::build_native_cdylib) and wrap an exported
logos_native_<fn> symbol as a NativeFn the VM dispatches through the existing
NativeSlot::Ready path — no new dispatch, the hot-swap seam already exists.
Sound subset: ALL-INT signatures (every param + the return Int). Those cross by
value in general-purpose registers, so a single i64 calling convention is exact.
Float/Bool need per-type fn-pointer ABIs (f64 rides XMM) and are deferred — a
function outside the subset simply gets no AOT fn and stays on VM+JIT (no gap).
The interpreter is the only caller of the loaded symbol, and ownership of the
Library is held for the program’s lifetime (an Arc inside the NativeFn), so
the code stays mapped while any call can occur.
Structs§
- AotNative
Fn - One AOT-native function: the resolved symbol address, its arity, the
Libraryit lives in (kept alive), and a call counter for observability/tests.Send + Syncbecause the address is immutable and the code is read-only once loaded.
Functions§
- load_
aot_ native dlopenpathand resolve the AOT-nativesymbol(logos_native_<fn>) as an all-Int function ofarity, wrapping it as aNativeFnplus its shared call counter. ReturnsNoneif the library or symbol cannot be loaded (the caller then keeps the function on VM+JIT — no gap at the seam).