Type

Entities for represent values or objects used within WasmVM

Types out of WebAssembly specification (extended) are denoted as [ext]

Fundamental types

Represent basic values or date references

using WasmVM::i32_t = int32_t

32-bit signed integer

using WasmVM::i64_t = int64_t

64-bit signed integer

using WasmVM::f32_t = float

32-bit (single precision) floating-point number

using WasmVM::f64_t = double

64-bit (double precision) floating-point number

using WasmVM::funcref_t = std::optional<index_t>

Nullable reference of function

using WasmVM::externref_t = void*

Nullable reference of external objects

using WasmVM::i8_t = int8_t

[ext] 8-bit signed integer

using WasmVM::u8_t = uint8_t

[ext] 8-bit unsigned integer

using WasmVM::i16_t = int16_t

[ext] 16-bit signed integer

using WasmVM::u16_t = uint16_t

[ext] 16-bit unsigned integer

using WasmVM::u32_t = uint32_t

[ext] 32-bit unsigned integer

using WasmVM::u64_t = uint64_t

[ext] 64-bit unsigned integer

using WasmVM::byte_t = std::byte

[ext] Single byte

using WasmVM::index_t = u32_t

[ext] Index of objects

using WasmVM::offset_t = u64_t

[ext] Offset of objects

using WasmVM::align_t = uint8_t

[ext] Memory alignment

Constants

constexpr u64_t WasmVM::page_size = 65536

Memory page size

constexpr index_t WasmVM::index_npos = -1

[ext] Undefined (non-existing) index

Enumerations

enum WasmVM::ValueType
enumerator i32

Denote i32_t value

enumerator i64

Denote i64_t value

enumerator f32

Denote f32_t value

enumerator f64

Denote f64_t value

enumerator funcref

Denote funcref_t value

enumerator externref

Denote externref_t value

enum WasmVM::RefType
enumerator funcref

Denote function reference value

enumerator externref

Denote external object reference value

Object types

using WasmVM::Value = std::variant<i32_t, i64_t, f32_t, f64_t, funcref_t, externref_t>

General type of value

using WasmVM::Ref = std::variant<funcref_t, externref_t>

Reference type

struct WasmVM::Limits

Limits of ranged objects or values

offset_t min

Minimum value

std::optional<offset_t> max

[Optional] Maximum value

struct WasmVM::FuncType

Declarational type (signature) of function

std::vector<ValueType> params

Value types of function parameters

std::vector<ValueType> results

Value types of function results (return values)

using WasmVM::MemType = Limits

Declarational type (signature) of memory

struct WasmVM::TableType

Declarational type (signature) of table

Limits Limits

Limits of table

RefType reftype

Specify the reference type of table elements

struct WasmVM::GlobalType

Declarational type (signature) of global

enum Mut

Declarational type for denoting mutability of the global

enumerator constant

The global value is immutable

enumerator variable

The global value is variable

Mut mut

Specify the mutability

ValueType type

Specify the type of global value

struct WasmVM::ExternVal

Declarational type (signature) of external values or objects

enum ExternType
enumerator Func

Indicate the external value is function

enumerator Mem

Indicate the external value is memory

enumerator Table

Indicate the external value is table

enumerator Global

Indicate the external value is global

ExternType type
index_t addr

Specify the type of global value