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§
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))
wheremsg
the string built by callingformat!
on the arguments to this macro.
Structs§
- 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.
- 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.
- 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.
- 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 deduplicated type (imported or defined) inside a WebAssembly module.
- All types used in a core wasm module.
- A builder for
ModuleTypes
. - 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. - 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
- WebAssembly function type – equivalent of
wasmparser
’s FuncType. - Information about a function, such as trap information, address map, and stack maps.
- WebAssembly reference type – equivalent of
wasmparser
’s RefType
Enums§
- 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
- 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.
- Types of objects that can be created by
Compiler::object
- Different kinds of expression that can initialize table elements.
- 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 WebAssembly translation error.
- WebAssembly heap type – equivalent of
wasmparser
’s HeapType - 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. - Equivalent of
VMCONTEXT_MAGIC
except for native-call 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§
- A type wrapping a small integer index should implement
EntityRef
so it can be used as the key of anSecondaryMap
orSparseMap
. - Trait used for the
ptr
representation of the field ofVMOffsets
- 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 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.