Instance

Stack

struct WasmVM::Stack
Stack(Store &store)
void invoke(index_t funcaddr, std::vector<Value> args)
std::vector<Value> run()
Store &store
std::stack<Frame> frames
std::vector<Value> results
struct WasmVM::Frame

Per-call activation frame pushed onto Stack::frames.

Frame(ModuleInst &module, index_t funcaddr)
std::stack<Label> labels
std::vector<Value> locals
ModuleInst &module
index_t funcaddr
struct WasmVM::Label
size_t arity
std::optional<Counters> pc
Values values
std::vector<CatchEntry> catches

Non-empty for try_table labels (exception-handling proposal).

struct WasmVM::Label::CatchEntry

A single catch clause of a try_table label.

enum Kind
enumerator Catch
enumerator CatchRef
enumerator CatchAll
enumerator CatchAllRef
Kind kind
index_t tag_addr

Resolved tag address (only valid for Catch / CatchRef).

index_t label_idx

Branch target label index.

struct WasmVM::Label::Values : public std::stack<Value>
std::vector<Value> get()
void insert(std::vector<Value>)
struct WasmVM::Label::Counters : public std::pair<size_t, size_t>
size_t &current
size_t &continuation

Store

struct WasmVM::Store
std::vector<FuncInst> funcs
std::vector<TableInst> tables
std::vector<MemInst> mems
std::vector<GlobalInst> globals
std::vector<ElemInst> elems
std::vector<DataInst> datas
std::vector<TagInst> tags

Instances

using WasmVM::hostfunc_t = std::vector<Value> (*)(Stack&)
struct WasmVM::ModuleInst
std::vector<FuncType> types
std::vector<index_t> funcaddrs
std::vector<index_t> tableaddrs
std::vector<index_t> memaddrs
std::vector<index_t> globaladdrs
std::vector<index_t> elemaddrs
std::vector<index_t> dataaddrs
std::vector<index_t> tagaddrs
std::vector<ExportInst> exports
void reset()
struct WasmVM::FuncInst
FuncInst(ModuleInst &module)
FuncType type
ModuleInst &module
std::variant<hostfunc_t, WasmFunc> body
struct WasmVM::TableInst
TableType type
std::vector<WasmVM::Ref> elems
struct WasmVM::MemInst
MemType type
std::vector<byte_t> data
struct WasmVM::GlobalInst
ValueType type
Value value
struct WasmVM::ElemInst
RefType type
std::vector<Ref> elem
using WasmVM::DataInst = std::vector<byte_t>
struct WasmVM::ExportInst
std::string name
ExternVal value