summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-stack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-stack.cpp')
-rw-r--r--src/wasm/wasm-stack.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index 1f5722b59..694ed4269 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -2264,7 +2264,11 @@ void BinaryInstWriter::visitStringNew(StringNew* curr) {
o << int8_t(BinaryConsts::GCPrefix);
switch (curr->op) {
case StringNewUTF8:
- o << U32LEB(BinaryConsts::StringNewWTF8);
+ if (!curr->try_) {
+ o << U32LEB(BinaryConsts::StringNewWTF8);
+ } else {
+ o << U32LEB(BinaryConsts::StringNewUTF8Try);
+ }
o << int8_t(0); // Memory index.
o << U32LEB(BinaryConsts::StringPolicy::UTF8);
break;
@@ -2283,8 +2287,12 @@ void BinaryInstWriter::visitStringNew(StringNew* curr) {
o << int8_t(0); // Memory index.
break;
case StringNewUTF8Array:
- o << U32LEB(BinaryConsts::StringNewWTF8Array)
- << U32LEB(BinaryConsts::StringPolicy::UTF8);
+ if (!curr->try_) {
+ o << U32LEB(BinaryConsts::StringNewWTF8Array);
+ } else {
+ o << U32LEB(BinaryConsts::StringNewUTF8ArrayTry);
+ }
+ o << U32LEB(BinaryConsts::StringPolicy::UTF8);
break;
case StringNewWTF8Array:
o << U32LEB(BinaryConsts::StringNewWTF8Array)
@@ -2297,6 +2305,9 @@ void BinaryInstWriter::visitStringNew(StringNew* curr) {
case StringNewWTF16Array:
o << U32LEB(BinaryConsts::StringNewWTF16Array);
break;
+ case StringNewFromCodePoint:
+ o << U32LEB(BinaryConsts::StringFromCodePoint);
+ break;
default:
WASM_UNREACHABLE("invalid string.new*");
}