summaryrefslogtreecommitdiff
path: root/src/ir/cost.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-09-30 17:54:05 -0700
committerGitHub <noreply@github.com>2021-09-30 17:54:05 -0700
commit65bcde2c30e82047a892332b95b114bc86f89614 (patch)
treefad936a8ed9b3275da50917bcebcbc235ab82600 /src/ir/cost.h
parentce8cdac461db4e0a3e178a59f8eb1447bfee51e1 (diff)
downloadbinaryen-65bcde2c30e82047a892332b95b114bc86f89614.tar.gz
binaryen-65bcde2c30e82047a892332b95b114bc86f89614.tar.bz2
binaryen-65bcde2c30e82047a892332b95b114bc86f89614.zip
Implement table.get (#4195)
Adds the part of the spec test suite that this passes (without table.set we can't do it all).
Diffstat (limited to 'src/ir/cost.h')
-rw-r--r--src/ir/cost.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ir/cost.h b/src/ir/cost.h
index 29fcb8dd4..12797b0b5 100644
--- a/src/ir/cost.h
+++ b/src/ir/cost.h
@@ -540,6 +540,7 @@ struct CostAnalyzer : public OverriddenVisitor<CostAnalyzer, CostType> {
CostType visitRefEq(RefEq* curr) {
return 1 + visit(curr->left) + visit(curr->right);
}
+ CostType visitTableGet(TableGet* curr) { return 1 + visit(curr->index); }
CostType visitTry(Try* curr) {
// We assume no exception will be thrown in most cases
return visit(curr->body);