Crate wasmer_vm

Source
Expand description

Runtime library support for Wasmer.

Modules§

libcalls
Runtime library calls.
traphandlers
WebAssembly trap handling, which is built on top of the lower-level signalhandling mechanisms.

Structs§

ExportFunction
A function export value with an extra function pointer to initialize host environments.
ExportFunctionMetadata
Extra metadata about ExportFunctions.
FuncDataRegistry
The registry that holds the values that VMFuncRefs point to.
FunctionBodyPtr
A pointer to the beginning of the function body.
FunctionExtent
Represents a continuous region of executable memory starting with a function entry point.
Global
A Global instance
Imports
Resolved import pointers.
InstanceAllocator
This is an intermediate type that manages the raw allocation and metadata when creating an [Instance].
InstanceHandle
A handle holding an InstanceRef, which holds an Instance of a WebAssembly module.
LinearMemory
A linear memory instance.
LinearTable
A table instance.
Mmap
A simple struct consisting of a page-aligned pointer to page-aligned and initially-zeroed memory and a length.
ModuleInfo
A translated WebAssembly module, excluding the function bodies and memory initializers.
NamedResolverChain
A Resolver that links two resolvers together in a chain.
NullResolver
Resolver implementation that always resolves to None. Equivalent to ().
SectionBodyPtr
Pointers to section data.
SignatureRegistry
WebAssembly requires that the caller and callee signatures in an indirect call must match. To implement this efficiently, keep a registry of all signatures, shared by all instances, so that call sites can just do an index comparison.
TargetSharedSignatureIndex
Target specific type for shared signature index.
TlsRestore
Opaque state used to help control TLS state across stack switches for async support.
VMBuiltinFunctionIndex
An index type for builtin functions.
VMCallerCheckedAnyfunc
The VM caller-checked “anyfunc” record, for caller-side signature checking. It consists of the actual function pointer and a signature id to be checked by the caller.
VMContext
The VM “context”, which is pointed to by the vmctx arg in the compiler. This has information about globals, memories, tables, and other runtime state associated with the current instance.
VMDynamicFunctionContext
The VMDynamicFunctionContext is the context that dynamic functions will receive when called (rather than vmctx). A dynamic function is a function for which we don’t know the signature until runtime.
VMExternRef
This type does not do reference counting automatically, reference counting can be done with Self::ref_clone and Self::ref_drop.
VMFuncRef
A function reference. A single word that points to metadata about a function.
VMFunction
A function export value.
VMFunctionBody
A placeholder byte-sized type which is just used to provide some amount of type safety when dealing with pointers to JIT-compiled function bodies. Note that it’s deliberately not Copy, as we shouldn’t be carelessly copying function body bytes around.
VMFunctionImport
An imported function.
VMGlobal
A global export value.
VMGlobalDefinition
The storage for a WebAssembly global defined within the instance.
VMGlobalImport
The fields compiled code needs to access to utilize a WebAssembly global variable imported from another instance.
VMImport
A module import.
VMLocalFunction
A locally defined function.
VMMemory
A memory export value.
VMMemoryDefinition
The fields compiled code needs to access to utilize a WebAssembly linear memory defined within the instance, namely the start address and the size in bytes.
VMMemoryImport
The fields compiled code needs to access to utilize a WebAssembly linear memory imported from another instance.
VMOffsets
This class computes offsets to fields within VMContext and other related structs that JIT code accesses directly.
VMSharedSignatureIndex
An index into the shared signature registry, usable for checking signatures at indirect calls.
VMTable
A table export value.
VMTableDefinition
The fields compiled code needs to access to utilize a WebAssembly table defined within the instance.
VMTableImport
The fields compiled code needs to access to utilize a WebAssembly table imported from another instance.

Enums§

Export
The value of an export passed from one instance to another.
GlobalError
Error type describing things that can go wrong when operating on Wasm Globals.
ImportFunctionEnv
A collection of data about host envs used by imported functions.
MemoryError
Error type describing things that can go wrong when operating on Wasm Memories.
MemoryStyle
Implementation styles for WebAssembly linear memory.
TableElement
A reference stored in a table. Can be either an externref or a funcref.
TableStyle
Implementation styles for WebAssembly tables.
Trap
Stores trace message with backtrace.
TrapCode
A trap code describing the reason for a trap.
VMExtern
The value of an export passed from one instance to another.
VMFunctionKind
A function kind is a calling convention into and out of wasm code.
VMImportType
Type of the import.
WeakOrStrongInstanceRef
An InstanceRef that may or may not be keeping the Instance alive.

Constants§

VERSION
Version number of this crate.

Statics§

PROBESTACK
The probestack based on the Rust probestack

Traits§

Artifact
A predecesor of a full module Instance.
ChainableNamedResolver
A trait for chaining resolvers together.
Instantiatable
Artifacts that can be instantiated.
Memory
Trait for implementing Wasm Memory used by Wasmer.
NamedResolver
Import resolver connects imports with available exported values.
Resolver
Import resolver connects imports with available exported values.
Table
Trait for implementing the interface of a Wasm table.
Tunables
An engine delegates the creation of memories, tables, and globals to a foreign implementor of this trait.

Functions§

catch_traps
Catches any wasm traps that happen within the execution of closure, returning them as a Result.
catch_traps_with_result
Catches any wasm traps that happen within the execution of closure, returning them as a Result, with the closure contents.
initialize_host_envs
Initializes the host environments.
raise_lib_trap
Raises a trap from inside library code immediately.
raise_user_trap
Raises a user-defined trap immediately.
resume_panic
Carries a Rust panic across wasm code and resumes the panic on the other side.
wasmer_call_trampoline
Call the VM function pointed to by callee.

Type Aliases§

ImportInitializerFuncPtr
The function pointer to call with data and an [Instance] pointer to finish initializing the host env.
VMTrampoline

Unions§

VMFunctionEnvironment
Union representing the first parameter passed when calling a function.