diff options
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r-- | src/wasm-binary.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 7666fa842..39980ee04 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -346,6 +346,10 @@ enum EncodedType { externref = -0x11, // 0x6f // any reference type anyref = -0x12, // 0x6e + // comparable reference type + eqref = -0x13, // 0x6d + // integer reference type + i31ref = -0x16, // 0x6a // exception reference type exnref = -0x18, // 0x68 // func_type form @@ -358,6 +362,8 @@ enum EncodedHeapType { func = -0x10, // 0x70 extern_ = -0x11, // 0x6f any = -0x12, // 0x6e + eq = -0x13, // 0x6d + i31 = -0x17, // 0x69, != i31ref exn = -0x18, // 0x68 }; @@ -981,6 +987,12 @@ inline S32LEB binaryType(Type type) { case Type::anyref: ret = BinaryConsts::EncodedType::anyref; break; + case Type::eqref: + ret = BinaryConsts::EncodedType::eqref; + break; + case Type::i31ref: + ret = BinaryConsts::EncodedType::i31ref; + break; case Type::unreachable: WASM_UNREACHABLE("unexpected type"); } @@ -1003,11 +1015,15 @@ inline S32LEB binaryHeapType(HeapType type) { ret = BinaryConsts::EncodedHeapType::any; break; case HeapType::EqKind: + ret = BinaryConsts::EncodedHeapType::eq; + break; case HeapType::I31Kind: + ret = BinaryConsts::EncodedHeapType::i31; + break; case HeapType::SignatureKind: case HeapType::StructKind: case HeapType::ArrayKind: - WASM_UNREACHABLE("TODO: GC types"); + WASM_UNREACHABLE("TODO: compound GC types"); } return S32LEB(ret); // TODO: Actually encoded as s33 } |