Function wasmtime_jit::finish_compile
source · [−]pub fn finish_compile(
translation: ModuleTranslation<'_>,
obj: Object<'_>,
funcs: PrimaryMap<DefinedFuncIndex, FunctionInfo>,
trampolines: Vec<Trampoline>,
tunables: &Tunables
) -> Result<(MmapVec, CompiledModuleInfo)>Expand description
Finishes compilation of the translation specified, producing the final
compilation artifact and auxiliary information.
This function will consume the final results of compiling a wasm module
and finish the ELF image in-progress as part of obj by appending any
compiler-agnostic sections.
The auxiliary CompiledModuleInfo structure returned here has also been
serialized into the object returned, but if the caller will quickly
turn-around and invoke CompiledModule::from_artifacts after this then the
information can be passed to that method to avoid extra deserialization.
This is done to avoid a serialize-then-deserialize for API calls like
Module::new where the compiled module is immediately going to be used.
The MmapVec returned here contains the compiled image and resides in
mmap’d memory for easily switching permissions to executable afterwards.