From 6bac16b3895d6d94007fcdc5c098d52ba2a408e5 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 18 Jul 2022 15:50:22 -0700 Subject: [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. --- src/wasm/wasm-stack.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/wasm/wasm-stack.cpp') 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*"); } -- cgit v1.2.3