summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-07-14 17:10:15 -0700
committerGitHub <noreply@github.com>2022-07-15 00:10:15 +0000
commit2b31aeb98a0fc8a5a505b3998d44990ed14e8c38 (patch)
treeb7e28f6ad6e3f77222e724afdb6d8668054410ea /src/wasm-binary.h
parentc0151e99996a7b51d3d135fd5018c69e146b5c02 (diff)
downloadbinaryen-2b31aeb98a0fc8a5a505b3998d44990ed14e8c38.tar.gz
binaryen-2b31aeb98a0fc8a5a505b3998d44990ed14e8c38.tar.bz2
binaryen-2b31aeb98a0fc8a5a505b3998d44990ed14e8c38.zip
[Strings] stringview_*.slice (#4805)
Unfortunately one slice is the same as python [start:end], using 2 params, and the other slice is one param, [CURR:CURR+num] (where CURR is implied by the current state in the iter). So we can't use a single class here. Perhaps a different name would be good, like slice vs substring (like JS does), but I picked names to match the current spec.
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r--src/wasm-binary.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index 9c5d6cd98..ba8d547d8 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -1149,12 +1149,15 @@ enum ASTNodes {
StringIsUSV = 0x8a,
StringAsWTF8 = 0x90,
StringViewWTF8Advance = 0x91,
+ StringViewWTF8Slice = 0x93,
StringAsWTF16 = 0x98,
StringViewWTF16GetCodePoint = 0x9a,
+ StringViewWTF16Slice = 0x9c,
StringAsIter = 0xa0,
StringViewIterNext = 0xa1,
StringViewIterAdvance = 0xa2,
StringViewIterRewind = 0xa3,
+ StringViewIterSlice = 0xa4,
};
enum MemoryAccess {
@@ -1746,6 +1749,8 @@ public:
bool maybeVisitStringWTF16Get(Expression*& out, uint32_t code);
bool maybeVisitStringIterNext(Expression*& out, uint32_t code);
bool maybeVisitStringIterMove(Expression*& out, uint32_t code);
+ bool maybeVisitStringSliceWTF(Expression*& out, uint32_t code);
+ bool maybeVisitStringSliceIter(Expression*& out, uint32_t code);
void visitSelect(Select* curr, uint8_t code);
void visitReturn(Return* curr);
void visitMemorySize(MemorySize* curr);