[][src]Crate wasmer_vm

Runtime library support for Wasmer.

Modules

libcalls

Runtime library calls.

Structs

ExportsIterator

This iterator allows us to iterate over the exports and offer nice API ergonomics over it.

FunctionBodyPtr

A safe wrapper around VMFunctionBody.

Global

A Global instance

Imports

Resolved import pointers.

ImportsIterator

This iterator allows us to iterate over the imports and offer nice API ergonomics over it.

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.

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.

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.

VMExportFunction

A function export value.

VMExportGlobal

A global export value.

VMExportMemory

A memory export value.

VMExportTable

A table 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.

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.

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.

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

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.

TableStyle

Implementation styles for WebAssembly tables.

Trap

Stores trace message with backtrace.

TrapCode

A trap code describing the reason for a trap.

VMExport

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

VERSION

Version number of this crate.

Statics

PROBESTACK

The probestack based on the Rust probestack

Traits

Memory

Trait for implementing Wasm Memory used by Wasmer.

Table

Trait for implementing the interface of a Wasm table.

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.

init_traps

This function performs the low-overhead signal handler initialization that we want to do eagerly to ensure a more-deterministic global process state.

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 wasm function pointed to by callee.

Type Definitions

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.