Skip to content

Commit c0463f1

Browse files
authored
Emit i31ref and dataref binary shorthands (#4844)
1 parent 9d20a4e commit c0463f1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/wasm/wasm-binary.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,13 +1409,11 @@ void WasmBinaryWriter::writeType(Type type) {
14091409
o << S32LEB(BinaryConsts::EncodedType::eqref);
14101410
return;
14111411
case HeapType::i31:
1412-
// TODO: Emit i31ref once V8 (and Binaryen itself) treats it as
1413-
// nullable.
1414-
break;
1412+
o << S32LEB(BinaryConsts::EncodedType::i31ref);
1413+
return;
14151414
case HeapType::data:
1416-
// TODO: Emit dataref once V8 (and Binaryen itself) treats it as
1417-
// nullable.
1418-
break;
1415+
o << S32LEB(BinaryConsts::EncodedType::dataref);
1416+
return;
14191417
case HeapType::string:
14201418
o << S32LEB(BinaryConsts::EncodedType::stringref);
14211419
return;

0 commit comments

Comments
 (0)