Crate wasmtime_environ

source ·
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§

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.
  • Rust module prelude for Wasmtime crates.
  • A simple event-driven library for parsing WebAssembly binary files (or streams).

Macros§

  • Creates a String using interpolation of runtime expressions.
  • 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§

  • A slice mapping K -> V allocating dense entity references.
  • An index type for builtin functions.
  • Index of a call_indirect instruction in a module, used for caching that callsite’s target in the VMContext.
  • Secondary in-memory results of function compilation.
  • Secondary in-memory results of module compilation.
  • A constant expression.
  • 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.
  • Index type of a canonicalized recursive type group inside the whole engine (as opposed to canonicalized within just a single Wasm 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.
  • Index into the funcref table within a VMContext for a function.
  • Description of where a function is located in the text section of a compiled image.
  • The name of a function stored in the ELF_NAME_DATA section.
  • 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.
  • Iterator type returned by iter_entity_range.
  • 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.
  • Metadata associated with a compiled ELF artifact.
  • A translated WebAssembly module, excluding the function bodies and memory initializers.
  • Index type of a canonicalized recursive type group inside a WebAssembly module (as opposed to canonicalized within the whole engine).
  • A canonicalized type index for a type within a single WebAssembly module.
  • 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.
  • A canonicalized type index referencing a type within a single recursion group from another type within that same recursion group.
  • Small data structure to help extend the lifetime of a slice to a higher scope.
  • A mapping K -> V for densely indexed entity references.
  • 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.
  • Index into the global list of modules found within an entire component.
  • WebAssembly table.
  • Index type of a table (imported or defined) inside the WebAssembly module.
  • Table initialization data for all tables in the module.
  • A WebAssembly table description along with our chosen style for implementing it.
  • A WebAssembly table initializer segment.
  • WebAssembly event.
  • Index type of an event inside the WebAssembly module.
  • Information about trap.
  • Tunable parameters for WebAssembly compilation.
  • Index type of a type (imported or defined) 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
  • A canonicalized type index into an engine’s shared type registry.
  • A concrete array type.
  • The type of a struct field or array element.
  • WebAssembly function type – equivalent of wasmparser’s FuncType.
  • Information about a function, such as trap information, address map, and stack maps.
  • A recursive type group.
  • WebAssembly reference type – equivalent of wasmparser’s RefType
  • A concrete struct type.
  • A concrete, user-defined (or host-defined) Wasm type.

Enums§

  • The subset of Wasm opcodes that are constant.
  • An interned type index, either at the module or engine level.
  • 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
  • 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.
  • Types of objects that can be created by Compiler::object
  • Initial value for all elements in a table.
  • Elements of a table segment, either a list of functions or list of arbitrary expressions.
  • Implementation styles for WebAssembly tables.
  • The kind of an object in a GC heap.
  • A function, array, or struct type.
  • A WebAssembly translation error.
  • A top heap type.
  • WebAssembly heap type – equivalent of wasmparser’s HeapType
  • Represents storage types introduced in the GC spec for array and struct fields.
  • WebAssembly value type – equivalent of wasmparser::ValType.

Constants§

Traits§

  • A type wrapping a small integer index should implement EntityRef so it can be used as the key of an SecondaryMap or SparseMap.
  • Convenience trait for converting Result<T, E> into anyhow::Result<T>
  • The various callbacks provided here are used to drive the smaller bits of memory initialization.
  • Convenience trait to convert a value into anyhow::Error
  • Trait used for the ptr representation of the field of VMOffsets
  • Trait for extracting keys from values stored in a SparseMap.
  • Helpers used to convert a wasmparser type to a type in this crate.
  • A trait for things that can trace all type-to-type edges, aka all type indices within this thing.
  • Helper trait used to add unsigned() methods to primitive signed integer types.

Functions§

  • Demangles a single function name into a user-readable form.
  • Demangles a function name if it’s provided, or returns a unified representation based on the function index otherwise.
  • Iterate over a Range<E: EntityRef>, yielding a sequence of E items.
  • Iterate over the address map contained in the given address map section.
  • 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 Aliases§

  • A sparse set of entity references.
  • A convenient alias for a Result that uses WasmError as the error type.