diff options
Diffstat (limited to 'src/wasm/wasm-binary.cpp')
-rw-r--r-- | src/wasm/wasm-binary.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index eea0a9c21..62c8a6cb3 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -1057,6 +1057,9 @@ void WasmBinaryWriter::writeType(Type type) { case Type::i31ref: ret = BinaryConsts::EncodedType::i31ref; break; + case Type::dataref: + ret = BinaryConsts::EncodedType::dataref; + break; default: WASM_UNREACHABLE("unexpected type"); } @@ -1089,6 +1092,9 @@ void WasmBinaryWriter::writeHeapType(HeapType type) { case HeapType::i31: ret = BinaryConsts::EncodedHeapType::i31; break; + case HeapType::data: + ret = BinaryConsts::EncodedHeapType::data; + break; } } else { WASM_UNREACHABLE("TODO: compound GC types"); @@ -1415,6 +1421,9 @@ Type WasmBinaryBuilder::getType(int initial) { case BinaryConsts::EncodedType::nonnullable: // FIXME: for now, force all inputs to be nullable return Type(getHeapType(), Nullable); + case BinaryConsts::EncodedType::dataref: + // FIXME: for now, force all inputs to be nullable + return Type(HeapType::BasicHeapType::data, Nullable); case BinaryConsts::EncodedType::i31ref: // FIXME: for now, force all inputs to be nullable return Type(HeapType::BasicHeapType::i31, Nullable); @@ -1456,6 +1465,8 @@ HeapType WasmBinaryBuilder::getHeapType() { return HeapType::eq; case BinaryConsts::EncodedHeapType::i31: return HeapType::i31; + case BinaryConsts::EncodedHeapType::data: + return HeapType::data; default: throwError("invalid wasm heap type: " + std::to_string(type)); } |