Expand description

Standalone environment for WebAssembly using Cranelift. Provides functions to translate get_global, set_global, memory.size, memory.grow, call_indirect that hardcode in the translation the base addresses of regions of memory that will hold the globals, tables and linear memories.

Re-exports

pub use object;

Modules

The Rust Core Library

Utilities for working with object files that operate as Wasmtime’s serialization and intermediate format for compiled modules.

Compact representation of Option<T> for types with a reserved value.

A simple event-driven library for parsing WebAssembly binary files (or streams).

Macros

Macro which provides the common implementation of a 32-bit entity reference.

Helper macro to iterate over all builtin functions and their signatures.

Return an Err(WasmError::Unsupported(msg)) where msg the string built by calling format! on the arguments to this macro.

Structs

Builder for the address map section of a wasmtime compilation image.

Index into the anyfunc table within a VMContext for a function.

A slice mapping K -> V allocating dense entity references.

An index type for builtin functions.

Index type of a passive data segment inside the WebAssembly module.

Index type of a defined function inside the WebAssembly module.

Index type of a defined global inside the WebAssembly module.

Index type of a defined memory inside the WebAssembly module.

Index type of a defined table inside the WebAssembly module.

Index type of a passive element segment inside the WebAssembly module.

A small list of entity references allocated from a pool.

A set of K for densely indexed entity references.

A position within an original source file,

Index type of a function (imported or defined) inside the WebAssembly module.

Contains function data: byte code and its offset in the module.

Information about a function, such as trap information, address map, and stack maps.

Type information about functions in a wasm module.

A WebAssembly global.

Index type of a global variable (imported or defined) inside the WebAssembly module.

Type representing the size of a pointer for the current compilation host

Single source location to generated address mapping.

Iterate over all keys in order.

Iterate over all keys in order.

Iterate over all keys in order.

A memory pool for storing lists of T.

WebAssembly linear memory.

Index type of a linear memory (imported or defined) inside the WebAssembly module.

A WebAssembly linear memory initializer.

A WebAssembly linear memory description along with our chosen style for implementing it.

A translated WebAssembly module, excluding the function bodies and memory initializers.

Object containing the standalone environment information.

The result of translating via ModuleEnvironment. Function bodies are not yet translated, and data initializers have not yet been copied out of the original buffer.

All types used in a core wasm module.

Index type of a defined memory inside the WebAssembly module.

A primary mapping K -> V allocating dense entity references.

Small data structure to help extend the lifetime of a slice to a higher scope.

A mapping K -> V for densely indexed entity references.

Description of compiler settings returned by CompilerBuilder::settings.

Index type of a signature (imported or defined) inside the WebAssembly module.

A sparse mapping of entity references.

A map for determining where live GC references live in a stack frame.

The offset within a function of a GC safepoint, and its associated stack map.

Similar to the above MemoryInitializer but only used when memory initializers are statically known to be valid.

WebAssembly table.

Index type of a table (imported or defined) inside the WebAssembly module.

A WebAssembly table initializer segment.

A WebAssembly table description along with our chosen style for implementing it.

WebAssembly event.

Index type of an event inside the WebAssembly module.

Information about a compiled trampoline which the host can call to enter wasm.

A helper structure to build the custom-encoded section of a wasmtime compilation image which encodes trap information.

Information about trap.

Tunable parameters for WebAssembly compilation.

Index type of a type inside the WebAssembly module.

This class computes offsets to fields within VMContext and other related structs that JIT code accesses directly.

Used to construct a VMOffsets

WebAssembly function type – equivalent of wasmparser’s FuncType.

Enums

An error while compiling WebAssembly to machine code.

An index of an entity.

A type of an item in a wasm module where an item is typically something that can be exported.

Value of a configured setting for a Compiler

Globals are initialized via the const operators or by referring to another import.

Argument to MemoryInitialization::init_memory indicating the current status of the instance.

Initialization routines for creating an instance, encompassing imports, modules, instances, aliases, etc.

The type of WebAssembly linear memory initialization to use for a module.

Implementation styles for WebAssembly linear memory.

Different types that can appear in a module.

Different kinds of Setting values that can be configured in a CompilerBuilder

Table initialization data for all tables in the module.

Implementation styles for WebAssembly tables.

A trap code describing the reason for a trap.

A WebAssembly translation error.

WebAssembly value type – equivalent of wasmparser’s Type.

Constants

A custom Wasmtime-specific section of our compilation image which stores mapping data from offsets in the image to offset in the original wasm binary.

A custom binary-encoded section of wasmtime compilation artifacts which encodes the ability to map an offset in the text section to the trap code that it corresponds to.

An “initialized bit” in a funcref table.

The mask we apply to all refs loaded from funcref tables.

Sentinel value indicating that wasm has been interrupted.

Version number of this crate.

Equivalent of VMCONTEXT_MAGIC except for host functions.

The number of pages (for 32-bit modules) we can have before we run out of byte index space.

The number of pages (for 64-bit modules) we can have before we run out of byte index space.

WebAssembly page sizes are defined to be 64KiB.

Traits

Implementation of an incremental compilation’s key/value cache store.

An implementation of a compiler which can compile WebAssembly functions to machine code and perform other miscellaneous tasks needed by the JIT runtime.

Abstract trait representing the ability to create a Compiler below.

A type wrapping a small integer index should implement EntityRef so it can be used as the key of an SecondaryMap or SparseMap.

Trait used for the ptr representation of the field of VMOffsets

Trait for extracting keys from values stored in a SparseMap.

Functions

Lookup an offset within an encoded address map section, returning the original FilePos that corresponds to the offset, if found.

Decodes the provided trap information section and attempts to find the trap code corresponding to the offset specified.

Type Definitions

A sparse set of entity references.

A convenient alias for a Result that uses WasmError as the error type.