Expand description
Runtime library support for Wasmtime.
Re-exports§
- pub use crate::mpk::MpkEnabled;
Modules§
- libcalls
- Runtime library calls.
- mpk
- Memory Protection Keys (MPK) implementation for use in striped memory allocation.
Structs§
- AsyncWasm Call State 
- Opaque state used to persist the state of the CallThreadStateactivations associated with a fiber stack that’s used as part of an async wasm call.
- Backtrace
- A WebAssembly stack trace.
- CallThread State 
- Temporary state stored on the stack which is registered in the tlsmodule below for calls into wasm.
- CompiledModule Id 
- A unique identifier (within an engine or similar) for a compiled module.
- CompiledModule IdAllocator 
- An allocator for compiled module IDs.
- DefaultMemory Creator 
- A default memory allocator used by Wasmtime
- ExportFunction 
- A function export value.
- ExportGlobal 
- A global export value.
- ExportMemory 
- A memory export value.
- ExportTable 
- A table export value.
- ExternRefHost Data Id 
- ID into the externrefhost data table.
- ExternRefHost Data Table 
- Side table for each externref’s host data value.
- Frame
- A stack frame within a Wasm stack trace.
- GcHeapAllocation Index 
- The index of a table allocation within an InstanceAllocator.
- GcRoot
- A GC root.
- GcRootsIter 
- An iterator over all the roots in a GcRootsList.
- GcRootsList 
- A list of GC roots.
- GcStore
- GC-related data that is one-to-one with a wasmtime::Store.
- I31
- A 31-bit integer for use with i31ref.
- Imports
- Resolved import pointers.
- Instance
- A type that roughly corresponds to a WebAssembly instance, but is also used for host-defined objects.
- InstanceAllocation Request 
- Represents a request for a new runtime instance.
- InstanceHandle 
- A handle holding an Instanceof a WebAssembly module.
- Memory
- Representation of a runtime wasm linear memory.
- MemoryAllocation Index 
- The index of a memory allocation within an InstanceAllocator.
- MemoryImage 
- One backing image for one memory.
- MemoryImage Slot 
- Slot management of a copy-on-write image which can be reused for the pooling allocator.
- Mmap
- A simple struct consisting of a page-aligned pointer to page-aligned and initially-zeroed memory and a length.
- MmapVec
- A type akin to Vec<u8>, but backed bymmapand able to be split.
- ModuleMemory Images 
- Backing images for memories in a module.
- OnDemandInstance Allocator 
- Represents the on-demand instance allocator.
- PreviousAsync Wasm Call State 
- Opaque state used to help control TLS state across stack switches for async support.
- SendSync Ptr 
- A helper type in Wasmtime to store a raw pointer to Twhile automatically inferring theSendandSynctraits for the container based on the properties ofT.
- StoreBox 
- A Box<T>lookalike for memory that’s stored in aStore<T>
- StorePtr 
- A pointer to a Store. This Option<*mut dyn Store> is wrapped in a struct so that the function to create a &mut dyn Store is a method on a member of InstanceAllocationRequest, rather than on a &mut InstanceAllocationRequest itself, because several use-sites require a split mut borrow on the InstanceAllocationRequest.
- TableAllocation Index 
- The index of a table allocation within an InstanceAllocator.
- Trap
- Stores trace message with backtrace.
- TypedGcRef 
- A GC reference to a heap object of concrete type T.
- UnwindRegistration 
- Represents a registration of function unwind information for System V ABI.
- VMArrayCall Host Func Context 
- The VM*Contextfor array-call host functions.
- VMContext
- The VM “context”, which is pointed to by the vmctxarg in Cranelift. This has information about globals, memories, tables, and other runtime state associated with the current instance.
- VMFuncRef 
- The VM caller-checked “funcref” record, for caller-side signature checking.
- VMFunctionBody 
- 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.
- VMFunctionImport 
- An imported function.
- VMGcHeader 
- The common header for all objects allocated in a GC heap.
- VMGcRef
- A raw, unrooted GC reference.
- VMGlobalDefinition 
- The storage for a WebAssembly global defined within the instance.
- VMGlobalImport 
- The fields compiled code needs to access to utilize a WebAssembly global variable imported from another instance.
- VMInvokeArgument 
- The storage for a WebAssembly invocation argument
- VMMemoryDefinition 
- 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.
- VMMemoryImport 
- The fields compiled code needs to access to utilize a WebAssembly linear memory imported from another instance.
- VMNativeCall Function 
- A function pointer that exposes the native calling convention.
- VMNativeCall Host Func Context 
- The VM*Contextfor native-call host functions.
- VMOpaqueContext 
- An “opaque” version of VMContextwhich must be explicitly casted to a target context.
- VMRuntimeLimits 
- Structure used to control interrupting wasm code.
- VMSharedType Index 
- An index into the shared type registry, usable for checking signatures at indirect calls.
- VMTableDefinition 
- The fields compiled code needs to access to utilize a WebAssembly table defined within the instance.
- VMTableImport 
- The fields compiled code needs to access to utilize a WebAssembly table imported from another instance.
- VMWasmCall Function 
- A function pointer that exposes the Wasm calling convention.
- WasmFault 
- Description about a fault that occurred in WebAssembly.
- Yield
- A small future that yields once and then returns.
Enums§
- CoreDump Stack 
- A WebAssembly Coredump
- Export
- The value of an export passed from one instance to another.
- GcProgress
- The result of doing an incremental amount of GC.
- SharedMemory 
- Table
- Represents an instance’s table.
- TableElement 
- An element going into or coming out of a table.
- TrapReason 
- Enumeration of different methods of raising a trap.
- VMExternRef 
- WaitResult 
- Result of Memory::atomic_wait32andMemory::atomic_wait64
Constants§
- VERSION
- Version number of this crate.
Traits§
- GarbageCollection 
- A garbage collection process.
- GcHeap
- A heap that manages garbage-collected objects.
- GcHeapObject 
- A trait implemented by all objects allocated inside a GC heap.
- GcRuntime
- Trait for integrating a garbage collector with the runtime.
- InstanceAllocator 
- A thing that can allocate instances.
- InstanceAllocator Impl 
- Trait that represents the hooks needed to implement an instance allocator.
- ModuleInfo 
- Used by the runtime to query module information.
- ModuleInfo Lookup 
- Used by the runtime to lookup information about a module given a program counter value.
- ModuleRuntime Info 
- Functionality required by this crate for a particular module. This is chiefly needed for lazy initialization of various bits of instance state.
- RuntimeLinear Memory 
- A linear memory
- RuntimeMemory Creator 
- A memory allocator
- Store
- Dynamic runtime functionality needed by this crate throughout the execution of a wasm instance.
Functions§
- catch_traps ⚠
- Catches any wasm traps that happen within the execution of closure, returning them as aResult.
- catch_unwind_ ⚠and_ longjmp 
- Invokes the closure fand returns the result.
- default_gc_ runtime 
- disabled_gc_ heap 
- Get a no-op GC heap for when GC is disabled (either statically at compile
time or dynamically due to it being turned off in the wasmtime::Config).
- get_stack_ pointer 
- init_traps 
- 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.
- page_size 
- Returns the host OS page size, in bytes.
- raise_lib_ ⚠trap 
- Raises a trap from inside library code immediately.
- raise_trap ⚠
- Raises a trap immediately.
- raise_user_ ⚠trap 
- Raises a user-defined trap immediately.
- tls_eager_ initialize 
- Eagerly initialize thread-local runtime functionality. This will be performed lazily by the runtime if users do not perform it eagerly.
Type Aliases§
- SignalHandler 
- Function which may handle custom signals while processing traps.
- V128Abi
- x86 vectors are represented with XMM registers which are represented
with the __m128itype. This type is considered a vector type for ABI purposes which is implemented by Cranelift.
- VMArrayCall Function 
- A function pointer that exposes the array calling convention.
Unions§
- ValRaw
- A “raw” and unsafe representation of a WebAssembly value.