Crate nanowasm [] [src]

An attempt at creating an embeddable wasm interpreter that's bloody easier to use and debug than the parity-wasm one.

Structs

Func

A function ready to be executed.

FuncIdx

An index into a module's function vector.

FuncInstance

Contains all the information needed to execute a function.

FuncType

A type signature for a function type, intended to go into the types section of a module.

FunctionAddress

Function address type; refers to a particular FuncInstance in the Store.

Global
GlobalAddress

Global address type

Interpreter

An interpreter which runs a particular program.

JumpTarget

For forward jumps (if, block) we need to know where to jump TO. Serialized wasm doesn't store this information explicitly, and searching for it mid-execution is a wasteful PITA, so we find it ahead of time and then store it when the function is instantiated.

LoadedModule

A loaded wasm module

Memory

A structure containing a memory space.

MemoryAddress

Memory address type

ModuleAddress

Module instance address type

ModuleInstance

Relates all the local indices to globals, functions etc. from within a module to the global addresses of the Store.

StackFrame

The activation record for an executing function.

State

All the immutable parts of the interpreter state.

Store

All the mutable parts of the interpreter state. This slightly wacky structure helps keep borrows from being awful, a little bit.

Table

A table.

TableAddress

Table address type

TypeIdx

An index into a module's type vector.

Enums

Value

An actual value used at runtime.

Traits

Extend

Convert one type to another by extending with leading zeroes or one's (depending on destination type)