diff options
author | Alon Zakai <azakai@google.com> | 2022-07-08 13:37:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-08 13:37:50 -0700 |
commit | fea11e95c67d51c464f00a5fcdfa6adb2c596f5e (patch) | |
tree | 1d4c310461568a66f43391389d7cff345d8615c7 /src/wasm/wasm-stack.cpp | |
parent | 75d059ad249b9dcedbaaf858747d60d299269d2c (diff) | |
download | binaryen-fea11e95c67d51c464f00a5fcdfa6adb2c596f5e.tar.gz binaryen-fea11e95c67d51c464f00a5fcdfa6adb2c596f5e.tar.bz2 binaryen-fea11e95c67d51c464f00a5fcdfa6adb2c596f5e.zip |
[Strings] string.is_usv_sequence (#4783)
This implements it as a StringMeasure opcode. They do have the same number of
operands, same trapping behavior, and same return type. They both get a string and
do some inspection of it to return an i32. Perhaps the name could be StringInspect
or something like that, rather than StringMeasure..? But I think for now this might be
good enough, and the spec may change anyhow later.
Diffstat (limited to 'src/wasm/wasm-stack.cpp')
-rw-r--r-- | src/wasm/wasm-stack.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp index 9a5db2928..e1b093b26 100644 --- a/src/wasm/wasm-stack.cpp +++ b/src/wasm/wasm-stack.cpp @@ -2276,6 +2276,9 @@ void BinaryInstWriter::visitStringMeasure(StringMeasure* curr) { case StringMeasureWTF16: o << U32LEB(BinaryConsts::StringMeasureWTF16); break; + case StringMeasureIsUSV: + o << U32LEB(BinaryConsts::StringIsUSV); + break; default: WASM_UNREACHABLE("invalid string.new*"); } |