Struct wasmtime_jit::CompiledModule
source · [−]pub struct CompiledModule { /* private fields */ }
Expand description
A compiled wasm module, ready to be instantiated.
Implementations
sourceimpl CompiledModule
impl CompiledModule
sourcepub fn from_artifacts_list(
artifacts: Vec<CompilationArtifacts>,
isa: &dyn TargetIsa,
profiler: &dyn ProfilingAgent
) -> Result<Vec<Self>, SetupError>
pub fn from_artifacts_list(
artifacts: Vec<CompilationArtifacts>,
isa: &dyn TargetIsa,
profiler: &dyn ProfilingAgent
) -> Result<Vec<Self>, SetupError>
Creates a list of compiled modules from the given list of compilation artifacts.
sourcepub fn from_artifacts(
artifacts: CompilationArtifacts,
isa: &dyn TargetIsa,
profiler: &dyn ProfilingAgent
) -> Result<Self, SetupError>
pub fn from_artifacts(
artifacts: CompilationArtifacts,
isa: &dyn TargetIsa,
profiler: &dyn ProfilingAgent
) -> Result<Self, SetupError>
Creates CompiledModule
directly from CompilationArtifacts
.
sourcepub unsafe fn instantiate(
&self,
imports: Imports<'_>,
lookup_shared_signature: &dyn Fn(SignatureIndex) -> VMSharedSignatureIndex,
mem_creator: Option<&dyn RuntimeMemoryCreator>,
interrupts: *const VMInterrupts,
host_state: Box<dyn Any>,
externref_activations_table: *mut VMExternRefActivationsTable,
stack_map_registry: *mut StackMapRegistry
) -> Result<InstanceHandle, InstantiationError>
pub unsafe fn instantiate(
&self,
imports: Imports<'_>,
lookup_shared_signature: &dyn Fn(SignatureIndex) -> VMSharedSignatureIndex,
mem_creator: Option<&dyn RuntimeMemoryCreator>,
interrupts: *const VMInterrupts,
host_state: Box<dyn Any>,
externref_activations_table: *mut VMExternRefActivationsTable,
stack_map_registry: *mut StackMapRegistry
) -> Result<InstanceHandle, InstantiationError>
Crate an Instance
from this CompiledModule
.
Note that if only one instance of this module is needed, it may be more
efficient to call the top-level instantiate
, since that avoids copying
the data initializers.
Unsafety
See InstanceHandle::new
sourcepub fn compilation_artifacts(&self) -> &CompilationArtifacts
pub fn compilation_artifacts(&self) -> &CompilationArtifacts
Extracts CompilationArtifacts
from the compiled module.
sourcepub fn data_initializers(&self) -> Vec<DataInitializer<'_>>
pub fn data_initializers(&self) -> Vec<DataInitializer<'_>>
Returns data initializers to pass to InstanceHandle::initialize
sourcepub fn module_mut(&mut self) -> Option<&mut Module>
pub fn module_mut(&mut self) -> Option<&mut Module>
Return a reference to a mutable module (if possible).
sourcepub fn finished_functions(
&self
) -> &PrimaryMap<DefinedFuncIndex, *mut [VMFunctionBody]>
pub fn finished_functions(
&self
) -> &PrimaryMap<DefinedFuncIndex, *mut [VMFunctionBody]>
Returns the map of all finished JIT functions compiled for this module
sourcepub fn trampolines(&self) -> &PrimaryMap<SignatureIndex, VMTrampoline>
pub fn trampolines(&self) -> &PrimaryMap<SignatureIndex, VMTrampoline>
Returns the per-signature trampolines for this module.
sourcepub fn stack_maps(
&self
) -> impl Iterator<Item = (*mut [VMFunctionBody], &[StackMapInformation])>
pub fn stack_maps(
&self
) -> impl Iterator<Item = (*mut [VMFunctionBody], &[StackMapInformation])>
Returns the stack map information for all functions defined in this module.
The iterator returned iterates over the span of the compiled function in memory with the stack maps associated with those bytes.
sourcepub fn trap_information(
&self
) -> impl Iterator<Item = (DefinedFuncIndex, *mut [VMFunctionBody], &[TrapInformation], &FunctionAddressMap)>
pub fn trap_information(
&self
) -> impl Iterator<Item = (DefinedFuncIndex, *mut [VMFunctionBody], &[TrapInformation], &FunctionAddressMap)>
Iterates over all functions in this module, returning information about how to decode traps which happen in the function.
sourcepub fn jit_code_ranges<'a>(
&'a self
) -> impl Iterator<Item = (usize, usize)> + 'a
pub fn jit_code_ranges<'a>(
&'a self
) -> impl Iterator<Item = (usize, usize)> + 'a
Returns all ranges convered by JIT code.
sourcepub fn code(&self) -> &Arc<ModuleCode>
pub fn code(&self) -> &Arc<ModuleCode>
Returns module’s JIT code.
sourcepub fn symbolize_context(&self) -> Result<Option<SymbolizeContext>, Error>
pub fn symbolize_context(&self) -> Result<Option<SymbolizeContext>, Error>
Creates a new symbolication context which can be used to further symbolicate stack traces.
Basically this makes a thing which parses debuginfo and can tell you what filename and line number a wasm pc comes from.
sourcepub fn has_unparsed_debuginfo(&self) -> bool
pub fn has_unparsed_debuginfo(&self) -> bool
Returns whether the original wasm module had unparsed debug information based on the tunables configuration.
Auto Trait Implementations
impl RefUnwindSafe for CompiledModule
impl Send for CompiledModule
impl Sync for CompiledModule
impl Unpin for CompiledModule
impl UnwindSafe for CompiledModule
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more