Skip to main content

aot_build_function

Function aot_build_function 

pub fn aot_build_function(
    source: &str,
    fn_name: &str,
    cache_dir: &Path,
) -> Option<Box<dyn NativeFn>>
Expand description

On-demand AOT-native build + load (HOTSWAP §Axis-3): compile fn_name (and its callees) to an optimized cdylib (cached), dlopen it, and return the loaded [crate::vm::NativeFn] ready to install via Vm::install_aot_native. None if the function is absent / outside the scalar subset / the build or load failed — the caller keeps it on VM+JIT. Blocking (runs rustc); the background worker (BgAotCompiler) calls this off the interpreter thread.