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
- Support for the component model in Wasmtime.
- Layout of Wasm GC objects in the deferred reference-counting collector.
- Wasmtime’s Fused Adapter Compiler of Trampolines (FACT)
- Layout of Wasm GC objects in the null garbage collector.
- 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.
Macros§
- Macro which provides the common implementation of a 32-bit entity reference.
- Helper macro, like
foreach_transcoder
, to iterate over builtins for components unrelated to transcoding. - Helper macro to iterate over all builtin functions and their signatures.
- Helper macro to iterate over the transcoders that the host will provide adapter modules through libcalls.
- Return an
Err(WasmError::Unsupported(msg))
wheremsg
the string built by callingformat!
on the arguments to this macro.
Structs§
- Builder for the address map section of a wasmtime compilation image.
- A slice mapping
K -> V
allocating dense entity references. - An index type for builtin functions.
- Secondary in-memory results of function compilation.
- Secondary in-memory results of module compilation.
- Optional tunable configuration options used in
wasmtime::Config
- 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.
- Contains function data: byte code and its offset in the module.
- 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.
- The layout of a GC-managed array.
- The layout for a GC-managed struct type.
- 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.
- Metadata associated with a compiled ELF artifact.
- A translated WebAssembly module, excluding the function bodies and memory initializers.
- Object containing the standalone environment information.
- 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.
- 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.
- A builder for
ModuleTypes
. - Helper structure to create an ELF file as a compilation artifact.
- 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. - Description of compiler settings returned by
CompilerBuilder::settings
. - 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 initializer segment.
- WebAssembly event.
- Index type of an event inside the WebAssembly module.
- 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 (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.
- A convert from
wasmparser
types to Wasmtime types.
Enums§
- The garbage collector implementation to use.
- An error while compiling WebAssembly to machine code.
- 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
- The layout of a GC-managed object.
- 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
- What relocations can be applied against.
- Different kinds of
Setting
values that can be configured in aCompilerBuilder
- Initial value for all elements in a table.
- Elements of a table segment, either a list of functions or list of arbitrary expressions.
- The kind of an object in a GC heap.
- A function, array, or struct type.
- A WebAssembly translation error.
- A bottom heap type.
- 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§
- An “initialized bit” in a funcref table.
- The mask we apply to all refs loaded from funcref tables.
- Discriminant to check whether GC reference is an
i31ref
or not. - A mask that can be used to check for non-null and non-i31ref GC references with a single bitwise-and operation.
- Version number of this crate.
- Magic value for core Wasm VM contexts.
- Equivalent of
VMCONTEXT_MAGIC
except for array-call host functions. - The minimum alignment of the
VMGcHeader
in bytes. - The offset of the
VMGcKind
field in theVMGcHeader
. - The size of the
VMGcHeader
in bytes. - The offset of the
VMSharedTypeIndex
field in theVMGcHeader
. - Maximum size, in bytes, of 32-bit memories (4G)
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 anSecondaryMap
orSparseMap
. - A type which can be the result of serializing an object.
- A trait for getting the layout of a Wasm GC struct or array inside a particular collector.
- The various callbacks provided here are used to drive the smaller bits of memory initialization.
- Trait used for the
ptr
representation of the field ofVMOffsets
- Helper trait used to add
signed()
methods to primitive unsigned integer types. - 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§
- Get the byte size of the given Wasm type when it is stored inside the GC heap.
- 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 ofE
items. - Iterate over the address map contained in the given address map section.
- Lookup an
offset
within an encoded address map section, returning the originalFilePos
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 usesWasmError
as the error type.