diff options
author | Jérôme Vouillon <jerome.vouillon@gmail.com> | 2023-05-12 23:43:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-12 14:43:09 -0700 |
commit | 71a151240241fd50c42d88fe0ba9800c03527387 (patch) | |
tree | de98957b6f5341c3b14147c0cf6e1753d38940fe /src/ir/effects.h | |
parent | d7b14a67ca4e9b111d5733239af88328cb779030 (diff) | |
download | binaryen-71a151240241fd50c42d88fe0ba9800c03527387.tar.gz binaryen-71a151240241fd50c42d88fe0ba9800c03527387.tar.bz2 binaryen-71a151240241fd50c42d88fe0ba9800c03527387.zip |
[Strings] Adopt new instruction binary encoding (#5714)
See WebAssembly/stringref#46.
This format is already adopted by V8: https://chromium-review.googlesource.com/c/v8/v8/+/3892695.
The text format is left unchanged (see #5607 for a discussion on the subject).
I have also added support for string.encode_lossy_utf8 and
string.encode_lossy_utf8 array (by allowing the replace policy for
Binaryen's string.encode_wtf8 instruction).
Diffstat (limited to 'src/ir/effects.h')
-rw-r--r-- | src/ir/effects.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h index 893ff2cae..b4987b12b 100644 --- a/src/ir/effects.h +++ b/src/ir/effects.h @@ -841,13 +841,13 @@ private: switch (curr->op) { case StringNewUTF8: case StringNewWTF8: - case StringNewReplace: + case StringNewLossyUTF8: case StringNewWTF16: parent.readsMemory = true; break; case StringNewUTF8Array: case StringNewWTF8Array: - case StringNewReplaceArray: + case StringNewLossyUTF8Array: case StringNewWTF16Array: parent.readsArray = true; break; @@ -865,11 +865,13 @@ private: parent.implicitTrap = true; switch (curr->op) { case StringEncodeUTF8: + case StringEncodeLossyUTF8: case StringEncodeWTF8: case StringEncodeWTF16: parent.writesMemory = true; break; case StringEncodeUTF8Array: + case StringEncodeLossyUTF8Array: case StringEncodeWTF8Array: case StringEncodeWTF16Array: parent.writesArray = true; |