Expand description
Runtime library support for Wasmer.
Modules§
- libcalls
- Runtime library calls.
- traphandlers
- WebAssembly trap handling, which is built on top of the lower-level signalhandling mechanisms.
Structs§
- Export
Function - A function export value with an extra function pointer to initialize host environments.
- Export
Function Metadata - Extra metadata about
ExportFunction
s. - Func
Data Registry - The registry that holds the values that
VMFuncRef
s point to. - Function
Body Ptr - A pointer to the beginning of the function body.
- Function
Extent - Represents a continuous region of executable memory starting with a function entry point.
- Global
- A Global instance
- Imports
- Resolved import pointers.
- Instance
Allocator - This is an intermediate type that manages the raw allocation and
metadata when creating an [
Instance
]. - Instance
Handle - A handle holding an
InstanceRef
, which holds anInstance
of a WebAssembly module. - Linear
Memory - A linear memory instance.
- Linear
Table - A table instance.
- Mmap
- A simple struct consisting of a page-aligned pointer to page-aligned and initially-zeroed memory and a length.
- Module
Info - A translated WebAssembly module, excluding the function bodies and memory initializers.
- Named
Resolver Chain - A
Resolver
that links two resolvers together in a chain. - Null
Resolver Resolver
implementation that always resolves toNone
. Equivalent to()
.- Section
Body Ptr - Pointers to section data.
- Signature
Registry - WebAssembly requires that the caller and callee signatures in an indirect call must match. To implement this efficiently, keep a registry of all signatures, shared by all instances, so that call sites can just do an index comparison.
- Target
Shared Signature Index - Target specific type for shared signature index.
- TlsRestore
- Opaque state used to help control TLS state across stack switches for async support.
- VMBuiltin
Function Index - An index type for builtin functions.
- VMCaller
Checked Anyfunc - The VM caller-checked “anyfunc” record, for caller-side signature checking. It consists of the actual function pointer and a signature id to be checked by the caller.
- VMContext
- The VM “context”, which is pointed to by the
vmctx
arg in the compiler. This has information about globals, memories, tables, and other runtime state associated with the current instance. - VMDynamic
Function Context - The
VMDynamicFunctionContext
is the context that dynamic functions will receive when called (rather thanvmctx
). A dynamic function is a function for which we don’t know the signature until runtime. - VMExtern
Ref - This type does not do reference counting automatically, reference counting can be done with
Self::ref_clone
andSelf::ref_drop
. - VMFunc
Ref - A function reference. A single word that points to metadata about a function.
- VMFunction
- A function export value.
- VMFunction
Body - 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.
- VMFunction
Import - An imported function.
- VMGlobal
- A global export value.
- VMGlobal
Definition - The storage for a WebAssembly global defined within the instance.
- VMGlobal
Import - The fields compiled code needs to access to utilize a WebAssembly global variable imported from another instance.
- VMImport
- A module import.
- VMLocal
Function - A locally defined function.
- VMMemory
- A memory export value.
- VMMemory
Definition - 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.
- VMMemory
Import - The fields compiled code needs to access to utilize a WebAssembly linear memory imported from another instance.
- VMOffsets
- This class computes offsets to fields within
VMContext
and other related structs that JIT code accesses directly. - VMShared
Signature Index - An index into the shared signature registry, usable for checking signatures at indirect calls.
- VMTable
- A table export value.
- VMTable
Definition - The fields compiled code needs to access to utilize a WebAssembly table defined within the instance.
- VMTable
Import - The fields compiled code needs to access to utilize a WebAssembly table imported from another instance.
Enums§
- Export
- The value of an export passed from one instance to another.
- Global
Error - Error type describing things that can go wrong when operating on Wasm Globals.
- Import
Function Env - A collection of data about host envs used by imported functions.
- Memory
Error - Error type describing things that can go wrong when operating on Wasm Memories.
- Memory
Style - Implementation styles for WebAssembly linear memory.
- Table
Element - A reference stored in a table. Can be either an externref or a funcref.
- Table
Style - Implementation styles for WebAssembly tables.
- Trap
- Stores trace message with backtrace.
- Trap
Code - A trap code describing the reason for a trap.
- VMExtern
- The value of an export passed from one instance to another.
- VMFunction
Kind - A function kind is a calling convention into and out of wasm code.
- VMImport
Type - Type of the import.
- Weak
OrStrong Instance Ref - An
InstanceRef
that may or may not be keeping theInstance
alive.
Constants§
- VERSION
- Version number of this crate.
Statics§
- PROBESTACK
- The probestack based on the Rust probestack
Traits§
- Artifact
- A predecesor of a full module Instance.
- Chainable
Named Resolver - A trait for chaining resolvers together.
- Instantiatable
Artifact
s that can be instantiated.- Memory
- Trait for implementing Wasm Memory used by Wasmer.
- Named
Resolver - Import resolver connects imports with available exported values.
- Resolver
- Import resolver connects imports with available exported values.
- Table
- Trait for implementing the interface of a Wasm table.
- Tunables
- An engine delegates the creation of memories, tables, and globals to a foreign implementor of this trait.
Functions§
- catch_
traps ⚠ - Catches any wasm traps that happen within the execution of
closure
, returning them as aResult
. - catch_
traps_ ⚠with_ result - Catches any wasm traps that happen within the execution of
closure
, returning them as aResult
, with the closure contents. - initialize_
host_ ⚠envs - Initializes the host environments.
- raise_
lib_ ⚠trap - Raises a trap from inside library code immediately.
- raise_
user_ ⚠trap - Raises a user-defined trap immediately.
- resume_
panic ⚠ - Carries a Rust panic across wasm code and resumes the panic on the other side.
- wasmer_
call_ ⚠trampoline - Call the VM function pointed to by
callee
.
Type Aliases§
- Import
Initializer Func Ptr - The function pointer to call with data and an [
Instance
] pointer to finish initializing the host env. - VMTrampoline
Unions§
- VMFunction
Environment - Union representing the first parameter passed when calling a function.