Meziantou.Framework.WasmEngine namespace

Classes

NameDescription
WasmAllocationExceptionA memory, a table or a value cannot be allocated or grow, or an index is out of bounds (a RangeError in JavaScript).
WasmCompileExceptionA module is not valid (a WebAssembly.CompileError in JavaScript).
WasmExceptionThe base class of the exceptions of the WebAssembly engine.
WasmExceptionReferenceAn exception of WebAssembly (an exception address). The store returns the same object for the same exception.
WasmExportAn export of a module.
WasmExternAn external value (https://webassembly.github.io/spec/core/exec/runtime.html#external-values): the store returns the same object for the same address.
WasmExternTypeAn external type: the type of an import or of an export.
WasmFunctionA function (a function address).
WasmFunctionTypeA function type. A type read from a module keeps the concrete heap types of its parameters and results.
WasmGcObjectA struct or an array of WebAssembly. The store returns the same object for the same struct or array.
WasmGlobalA global (a global address).
WasmGlobalTypeA global type (https://webassembly.github.io/spec/core/syntax/types.html#global-types).
WasmHostReferenceA host reference: a value of the host given to WebAssembly (an externref).
WasmI31ReferenceAn unboxed scalar reference (ref.i31).
WasmImportAn import of a module.
WasmImportAttributeMarks a method as the host function of an import of a WebAssembly module. The source generator writes a DefineWasmImports(WasmStore store, WasmImports? imports = null) method in the partial type that declares the method: it creates a host function per marked method, whose type and conversions are written at build time.
WasmImportsThe imports of an instantiation, by module and name (see WasmStore.Instantiate).
WasmInstanceAn instance of a module (a module instance).
WasmLinkExceptionThe imports do not match the module (a WebAssembly.LinkError in JavaScript).
WasmMemoryA memory (a memory address). The bytes of a memory that is not shared are a .NET array (WasmMemory.Data), replaced when the memory grows. The bytes of a shared memory are a WasmSharedMemoryBlock, which never moves: a shared memory can be used by the stores of every thread, and its methods can be called from any thread.
WasmMemoryTypeA memory type (https://webassembly.github.io/spec/core/syntax/types.html#memory-types): the limits are in pages of 64 KiB.
WasmModuleA compiled module (see WasmRuntime.Compile). It is immutable: it can be instantiated by the stores of its runtime, from any thread.
WasmRuntimeA WebAssembly runtime written in .NET: it decodes and validates the modules (WasmRuntime.Compile), and creates the stores where they are instantiated (WasmRuntime.CreateStore). The code is interpreted, and the functions that run often are compiled to .NET code when the platform supports dynamic code.
WasmRuntimeOptionsOptions of a WasmRuntime.
WasmSharedMemoryBlockThe bytes of a shared memory, allocated once for the capacity of the memory, whose address never changes: the memory grows within the capacity. The default blocks are pinned .NET arrays; set WasmStoreOptions.SharedMemoryAllocator to provide the bytes (e.g. the data block of a SharedArrayBuffer of a script engine). The members can be called from any thread.
WasmStoreA store (https://webassembly.github.io/spec/core/exec/runtime.html#store): the instances, functions, memories, tables, globals, tags and exceptions created in it. A store is not thread-safe: use it from one thread at a time. Dispose it to release its native resources; a store that is not disposed is released when it is collected.
WasmStoreOptionsOptions of a WasmStore (see WasmRuntime.CreateStore).
WasmTableA table (a table address).
WasmTableTypeA table type (https://webassembly.github.io/spec/core/syntax/types.html#table-types).
WasmTagA tag (a tag address): the identity of the exceptions.
WasmTagTypeA tag type: the types of the parameters of the exceptions.
WasmThrowExceptionWebAssembly threw an exception (throw, throw_ref), or a host function throws an exception in WebAssembly: a WasmHostCallback that throws this exception throws WasmThrowException.Exception in WebAssembly, where it can be caught.
WasmTrapExceptionThe execution of WebAssembly trapped (a WebAssembly.RuntimeError in JavaScript).
WasmTypeMismatchExceptionA value does not match the type of its destination (a TypeError in JavaScript).
WasmWaitSignalTells another thread that a thread is about to join the waiters of an address (see WasmMemory.AtomicWait): the native code of the wait sets it right before it waits, so that a notification sent once it is set reaches the wait, unless the thread stops for longer than the time the other thread waits after it sees it.

Structs

NameDescription
WasmValueA WebAssembly value (https://webassembly.github.io/spec/core/exec/runtime.html#values). The references are null (a null reference of any type), a WasmFunction, a WasmHostReference (a value of the host), a WasmI31Reference, a WasmGcObject or a WasmExceptionReference.
WasmValueTypeA value type: a number type, the vector type, or a reference type with its heap type.

Enums

NameDescription
WasmExternKindThe kind of an external type (https://webassembly.github.io/spec/core/syntax/types.html#external-types).
WasmHeapKindThe kind of a heap type (https://webassembly.github.io/spec/core/syntax/types.html#heap-types).
WasmTrapKindThe kind of a trap.
WasmValueKindThe kind of a value type (https://webassembly.github.io/spec/core/syntax/types.html#value-types).
WasmWaitResultThe result of WasmMemory.AtomicWait: the values of memory.atomic.wait32.

Delegates

NameDescription
WasmHostCallbackThe steps of a host function: the arguments are converted to the results, or an exception is thrown. A WasmThrowException throws its exception in WebAssembly; any other exception aborts the execution and is thrown by the call into WebAssembly.
WasmSharedMemoryAllocatorAllocates the bytes of a shared memory (see WasmStoreOptions.SharedMemoryAllocator).