Crate wasmer_vm

source ·
Expand description

Runtime library support for Wasmer.

Re-exports§

  • pub use crate::memory::initialize_memory_with_data;

Modules§

Structs§

  • A safe wrapper around VMFunctionBody.
  • Resolved import pointers.
  • This is an intermediate type that manages the raw allocation and metadata when creating an [Instance].
  • Internal handle to an object owned by the current context.
  • A simple struct consisting of a page-aligned pointer to page-aligned and initially-zeroed memory and a length.
  • A location in memory for a Waiter
  • Pointers to section data.
  • 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.
  • Handle to an object managed by a context.
  • Unique ID to identify a context.
  • Set of objects managed by a context.
  • Target specific type for shared signature index.
  • An index type for builtin functions.
  • 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.
  • Configuration for the the runtime VM Currently only the stack size is configurable
  • 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.
  • 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.
  • Underlying object referenced by a VMExternRef.
  • Represents an opaque reference to any data within WebAssembly.
  • A function reference. A single word that points to metadata about a function.
  • A function export value.
  • 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.
  • Underlying FunctionEnvironment used by a VMFunction.
  • An imported function.
  • A Global instance
  • The storage for a WebAssembly global defined within the instance.
  • The fields compiled code needs to access to utilize a WebAssembly global variable imported from another instance.
  • A handle holding an Instance of a WebAssembly module.
  • Represents linear memory that can be either owned or shared
  • 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.
  • The fields compiled code needs to access to utilize a WebAssembly linear memory imported from another instance.
  • This class computes offsets to fields within VMContext and other related structs that JIT code accesses directly.
  • A linear memory instance.
  • A shared linear memory instance.
  • An index into the shared signature registry, usable for checking signatures at indirect calls.
  • A table instance.
  • The fields compiled code needs to access to utilize a WebAssembly table defined within the instance.
  • The fields compiled code needs to access to utilize a WebAssembly table imported from another instance.

Enums§

  • The name of a runtime library routine.
  • 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.
  • Error type describing things that can go wrong when operating on Wasm Memories.
  • Implementation styles for WebAssembly linear memory.
  • A reference stored in a table. Can be either an externref or a funcref.
  • Implementation styles for WebAssembly tables.
  • Stores trace message with backtrace.
  • A trap code describing the reason for a trap.
  • The value of an export passed from one instance to another.
  • A function kind is a calling convention into and out of wasm code.

Constants§

  • Version number of this crate.

Statics§

  • The probestack based on the Rust probestack

Traits§

  • Represents memory that is used by the WebAsssembly module

Functions§

  • Catches any wasm traps that happen within the execution of closure, returning them as a Result.
  • 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.
  • 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.
  • Raises a trap from inside library code immediately.
  • Raises a user-defined trap immediately.
  • Carries a Rust panic across wasm code and resumes the panic on the other side.
  • Default stack size is 1MB.
  • Call the wasm function pointed to by callee.

Type Aliases§

Unions§

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