Expand description
Runtime library support for Wasmer.
Modules
- Runtime library calls.
Structs
- This iterator allows us to iterate over the exports and offer nice API ergonomics over it.
- A safe wrapper around
VMFunctionBody
. - Resolved import pointers.
- This iterator allows us to iterate over the imports and offer nice API ergonomics over it.
- This is an intermediate type that manages the raw allocation and metadata when creating an [
Instance
]. - Internal handle to an object owned by the current context.
- A simple struct consisting of a page-aligned pointer to page-aligned and initially-zeroed memory and a length.
- A translated WebAssembly module, excluding the function bodies and memory initializers.
- A location in memory for a Waiter
- Pointers to section data.
- 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.
- Handle to an object managed by a context.
- Unique ID to identify a context.
- Set of objects managed by a context.
- Target specific type for shared signature index.
- An index type for builtin functions.
- 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.
- 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. - 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. - Underlying object referenced by a
VMExternRef
. - Represents an opaque reference to any data within WebAssembly.
- A function reference. A single word that points to metadata about a function.
- A function export value.
- 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.
- Underlying FunctionEnvironment used by a
VMFunction
. - An imported function.
- A Global instance
- The storage for a WebAssembly global defined within the instance.
- The fields compiled code needs to access to utilize a WebAssembly global variable imported from another instance.
- A handle holding an
Instance
of a WebAssembly module. - Represents linear memory that can be either owned or shared
- 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.
- The fields compiled code needs to access to utilize a WebAssembly linear memory imported from another instance.
- This class computes offsets to fields within VMContext and other related structs that JIT code accesses directly.
- A linear memory instance.
- A shared linear memory instance.
- An index into the shared signature registry, usable for checking signatures at indirect calls.
- A table instance.
- The fields compiled code needs to access to utilize a WebAssembly table defined within the instance.
- The fields compiled code needs to access to utilize a WebAssembly table imported from another instance.
Enums
- The name of a runtime library routine.
- Data used by the generated code is generally located inline within the
VMContext
for items defined in an instance. Host-defined objects are allocated separately and owned directly by the context. - Error type describing things that can go wrong when operating on Wasm Memories.
- Implementation styles for WebAssembly linear memory.
- A reference stored in a table. Can be either an externref or a funcref.
- Implementation styles for WebAssembly tables.
- Stores trace message with backtrace.
- A trap code describing the reason for a trap.
- The value of an export passed from one instance to another.
- A function kind is a calling convention into and out of wasm code.
- Error that can occur during wait/notify calls.
Constants
- The probestack for 32bit Windows when compiled with MSVC (note the singular underscore)
- Version number of this crate.
Traits
- Represents memory that is used by the WebAsssembly module
Functions
- Catches any wasm traps that happen within the execution of
closure
, returning them as aResult
. - 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.
- When executing on the Wasm stack, temporarily switch back to the host stack to perform an operation that should not be constrainted by the Wasm stack limits.
- Raises a trap from inside library code immediately.
- Raises a user-defined trap immediately.
- Carries a Rust panic across wasm code and resumes the panic on the other side.
- Default stack size is 1MB.
- Call the wasm function pointed to by
callee
.
Type Definitions
- InstanceHandleDeprecatedThis type is deprecated, it has been replaced by VMinstance.
- Function which may handle custom signals while processing traps.
Unions
- Union representing the first parameter passed when calling a function.