[][src]Crate wasmtime_runtime

Runtime library support for Wasmtime.

Modules

libcalls

Runtime library calls. Note that wasm compilers may sometimes perform these inline rather than calling them, particularly when CPUs have special instructions which compute them directly.

Structs

GdbJitImageRegistration

Registeration for JIT image

Imports

Resolved import pointers.

InstanceHandle

A handle holding an Instance of a WebAssembly module.

LinkError

An link error while instantiating a module.

Mmap

A simple struct consisting of a page-aligned pointer to page-aligned and initially-zeroed memory and a length.

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.

TrapRegistrationGuard

RAII guard for deregistering traps

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 Cranelift. This has information about globals, memories, tables, and other runtime state associated with the current instance.

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.

VMInvokeArgument

The storage for a WebAssembly invocation argument

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.

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

Export

The value of an export passed from one instance to another.

InstantiationError

An error while instantiating a module.

Constants

VERSION

Version number of this crate.

Functions

get_mut_trap_registry

Gets guarded writable reference to traps registry

get_trap_registry

Gets guarded readable reference to traps registry

wasmtime_call

Call the wasm function pointed to by callee, which has no arguments or return values.

wasmtime_call_trampoline

Call the wasm function pointed to by callee. values_vec points to a buffer which holds the incoming arguments, and to which the outgoing return values will be written.

wasmtime_init_eager

This function performs the low-overhead signal handler initialization that we want to do eagerly to ensure a more-deterministic global process state. This is especially relevant for signal handlers since handler ordering depends on installation order: the wasm signal handler must run before the other crash handlers and since POSIX signal handlers work LIFO, this function needs to be called at the end of the startup process, after other handlers have been installed. This function can thus be called multiple times, having no effect after the first call.

wasmtime_init_finish

Assuming EnsureEagerProcessSignalHandlers has already been called, this function performs the full installation of signal handlers which must be performed per-thread. This operation may incur some overhead and so should be done only when needed to use wasm.