summaryrefslogtreecommitdiff
path: root/src/ir/effects.h
diff options
context:
space:
mode:
authorMax Graey <maxgraey@gmail.com>2021-10-18 22:48:50 +0300
committerGitHub <noreply@github.com>2021-10-18 12:48:50 -0700
commitf0a8de302b85441deb8864c9e20c561c934e27b8 (patch)
treeb71e540462b865891a0b63d25b0b16b9653fd04a /src/ir/effects.h
parent0bec0a4bbaf4859bb4c7a2f1c4ecda60ccab72f2 (diff)
downloadbinaryen-f0a8de302b85441deb8864c9e20c561c934e27b8.tar.gz
binaryen-f0a8de302b85441deb8864c9e20c561c934e27b8.tar.bz2
binaryen-f0a8de302b85441deb8864c9e20c561c934e27b8.zip
Add table.grow operation (#4245)
Diffstat (limited to 'src/ir/effects.h')
-rw-r--r--src/ir/effects.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h
index 7074df755..e33a33818 100644
--- a/src/ir/effects.h
+++ b/src/ir/effects.h
@@ -534,7 +534,6 @@ private:
parent.writesMemory = true;
parent.implicitTrap = true;
}
- void visitTableSize(TableSize* curr) { parent.readsTable = true; }
void visitConst(Const* curr) {}
void visitUnary(Unary* curr) {
switch (curr->op) {
@@ -592,6 +591,7 @@ private:
parent.isAtomic = true;
}
void visitMemoryGrow(MemoryGrow* curr) {
+ // TODO: find out if calls is necessary here
parent.calls = true;
// memory.grow technically does a read-modify-write operation on the
// memory size in the successful case, modifying the set of valid
@@ -613,6 +613,14 @@ private:
parent.writesTable = true;
parent.implicitTrap = true;
}
+ void visitTableSize(TableSize* curr) { parent.readsTable = true; }
+ void visitTableGrow(TableGrow* curr) {
+ // table.grow technically does a read-modify-write operation on the
+ // table size in the successful case, modifying the set of valid
+ // indices, and just a read operation in the failure case
+ parent.readsTable = true;
+ parent.writesTable = true;
+ }
void visitTry(Try* curr) {}
void visitThrow(Throw* curr) {
if (parent.tryDepth == 0) {