wasm_decode_gc (wasm v0.1.0)

View Source

The 0xFB opcode space: garbage collection.

Structs, arrays, i31 and the casts. Add a GC instruction here rather than in wasm_decode_code. Split out of wasm_decode_code for the same reason the vector opcodes were: it is a proposal's worth of instructions and inlining it would bury the rules around it.

Only a few immediate shapes appear:

shapeinstructions
type indexstruct.new, array.new, array.len and most others
type index and field indexthe struct.get family and struct.set
type index and data or element indexarray.new_data, array.init_elem
heap typeref.test, ref.cast, in nullable and non-nullable forms
flags, label and two heap typesbr_on_cast, br_on_cast_fail

Summary

Functions

instr(R0)

-spec instr(binary()) -> {tuple() | atom(), binary()}.