Types¶
Note
In some places, possible types include both type constructors or types denoted by type indices.
Thus, the binary format for type constructors corresponds to the encodings of small negative
Number Types¶
Number types are encoded by a single byte.
Vector Types¶
Vector types are also encoded by a single byte.
Reference Types¶
Reference types are also encoded by a single byte.
Value Types¶
Value types are encoded with their respective encoding as a number type, vector type, or reference type.
Note
Value types can occur in contexts where type indices are also allowed, such as in the case of block types.
Thus, the binary format for types corresponds to the signed LEB128 encoding of small negative
Result Types¶
Result types are encoded by the respective vectors of value types.
Function Types¶
Function types are encoded by the byte
Limits¶
Limits are encoded with a preceding flag indicating whether a maximum is present.
Memory Types¶
Memory types are encoded with their limits.
Table Types¶
Table types are encoded with their limits and the encoding of their element reference type.
Global Types¶
Global types are encoded by their value type and a flag for their mutability.