summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-stack.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-07-18 15:50:22 -0700
committerGitHub <noreply@github.com>2022-07-18 22:50:22 +0000
commit6bac16b3895d6d94007fcdc5c098d52ba2a408e5 (patch)
tree4bd055a212e48e5e8d65cc601174d185d2937eb8 /src/wasm/wasm-stack.cpp
parent2b31aeb98a0fc8a5a505b3998d44990ed14e8c38 (diff)
downloadbinaryen-6bac16b3895d6d94007fcdc5c098d52ba2a408e5.tar.gz
binaryen-6bac16b3895d6d94007fcdc5c098d52ba2a408e5.tar.bz2
binaryen-6bac16b3895d6d94007fcdc5c098d52ba2a408e5.zip
[Strings] stringview_wtf16.length (#4809)
This measures the length of a view, so it seems simplest to make it a sub-operation of the existing measure instruction.
Diffstat (limited to 'src/wasm/wasm-stack.cpp')
-rw-r--r--src/wasm/wasm-stack.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index 3707848d1..0e39862e7 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -2279,6 +2279,9 @@ void BinaryInstWriter::visitStringMeasure(StringMeasure* curr) {
case StringMeasureIsUSV:
o << U32LEB(BinaryConsts::StringIsUSV);
break;
+ case StringMeasureWTF16View:
+ o << U32LEB(BinaryConsts::StringViewWTF16Length);
+ break;
default:
WASM_UNREACHABLE("invalid string.new*");
}