Crate wasmer_vm

Source
Expand description

Runtime library support for Wasmer.

Re-exports§

pub use crate::memory::initialize_memory_with_data;

Modules§

libcalls
Runtime library calls.

Structs§

FunctionBodyPtr
A safe wrapper around VMFunctionBody.
Imports
Resolved import pointers.
InstanceAllocator
This is an intermediate type that manages the raw allocation and metadata when creating an [Instance].
InternalStoreHandle
Internal handle to an object owned by the current context.
Mmap
A simple struct consisting of a page-aligned pointer to page-aligned and initially-zeroed memory and a length.
NotifyLocation
A location in memory for a Waiter
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.
StoreHandle
Handle to an object managed by a context.
StoreId
Unique ID to identify a context.
StoreObjects
Set of objects managed by a context.
TargetSharedSignatureIndex
Target specific type for shared signature index.
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.
VMConfig
Configuration for the runtime VM Currently only the stack size is configurable
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.
VMExceptionObj
Underlying object referenced by a VMExceptionRef.
VMExceptionRef
Represents an opaque reference to any data within WebAssembly.
VMExternObj
Underlying object referenced by a VMExternRef.
VMExternRef
Represents an opaque reference to any data within WebAssembly.
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.
VMFunctionEnvironment
Underlying FunctionEnvironment used by a VMFunction.
VMFunctionImport
An imported function.
VMGlobal
A Global instance
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.
VMInstance
A handle holding an Instance of a WebAssembly module.
VMMemory
Represents linear memory that can be either owned or shared
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.
VMOwnedMemory
A linear memory instance.
VMSharedMemory
A shared linear memory instance.
VMSharedSignatureIndex
An index into the shared signature registry, usable for checking signatures at indirect calls.
VMTable
A table instance.
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.
VMTag
A tag export value.
VMTagImport
The fields compiled code needs to access to utilize a WebAssembly tag variable imported from another instance.

Enums§

LibCall
The name of a runtime library routine.
MaybeInstanceOwned
Data used by the generated code is generally located inline within the VMContext for items defined in an instance. Host-defined objects are allocated separately and owned directly by the context.
MemoryError
Error type describing things that can go wrong when operating on Wasm Memories.
MemoryStyle
Implementation styles for WebAssembly linear memory.
MmapType
The type of mmap to create
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.

Constants§

PROBESTACK
The probestack for 32bit Windows when compiled with MSVC (note the singular underscore)
VERSION
Version number of this crate.

Traits§

LinearMemory
Represents memory that is used by the WebAsssembly module
StoreObject
Trait to represent an object managed by a context. This is implemented on the VM types managed by the context.

Functions§

catch_traps
Catches any wasm traps that happen within the execution of closure, returning them as a Result.
init_traps
This function is required to be called before any WebAssembly is entered. This will configure global state such as signal handlers to prepare the process to receive wasm traps.
on_host_stack
When executing on the Wasm stack, temporarily switch back to the host stack to perform an operation that should not be constrainted by the Wasm stack limits.
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.
set_stack_size
Default stack size is 1MB.
wasmer_call_trampoline
Call the wasm function pointed to by callee.

Type Aliases§

TrapHandlerFn
Function which may handle custom signals while processing traps.
VMTrampoline
The type for tramplines in the VM.

Unions§

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