diff options
author | Alon Zakai <azakai@google.com> | 2022-07-13 14:38:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-13 14:38:10 -0700 |
commit | 9671e95adbfcf0984a7e9800a7ea2ed33e1670ad (patch) | |
tree | d7273e64ed26429d18568439cdfb7b1fb6369645 /src/ir/effects.h | |
parent | 7b9c18b98c020f887aa9cb1750543751ebe5c530 (diff) | |
download | binaryen-9671e95adbfcf0984a7e9800a7ea2ed33e1670ad.tar.gz binaryen-9671e95adbfcf0984a7e9800a7ea2ed33e1670ad.tar.bz2 binaryen-9671e95adbfcf0984a7e9800a7ea2ed33e1670ad.zip |
[Strings] stringview access operations (#4798)
Diffstat (limited to 'src/ir/effects.h')
-rw-r--r-- | src/ir/effects.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h index 393285924..7045d9382 100644 --- a/src/ir/effects.h +++ b/src/ir/effects.h @@ -751,6 +751,32 @@ private: // traps when ref is null. parent.implicitTrap = true; } + void visitStringWTF8Advance(StringWTF8Advance* curr) { + // traps when ref is null. + parent.implicitTrap = true; + } + void visitStringWTF16Get(StringWTF16Get* curr) { + // traps when ref is null. + parent.implicitTrap = true; + } + void visitStringIterNext(StringIterNext* curr) { + // traps when ref is null. + parent.implicitTrap = true; + // modifies state in the iterator. we model that as accessing heap memory + // in an array atm TODO consider adding a new effect type for this (we + // added one for arrays because struct/array operations often interleave, + // say with vtable accesses, but it's not clear adding overhead to this + // class is worth it for string iters) + parent.readsArray = true; + parent.writesArray = true; + } + void visitStringIterMove(StringIterMove* curr) { + // traps when ref is null. + parent.implicitTrap = true; + // see StringIterNext. + parent.readsArray = true; + parent.writesArray = true; + } }; public: |