summaryrefslogtreecommitdiff
path: root/src/ir/cost.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-07-07 10:32:57 -0700
committerGitHub <noreply@github.com>2022-07-07 10:32:57 -0700
commitdc73f07807400eb48b8c4bc173bae37f188fc90b (patch)
treeed9672cb7847c6d9d33657151dc76fa4cb519ff3 /src/ir/cost.h
parent876638f8fb5bfc8b264eddc6c0c0d54ed40d0095 (diff)
downloadbinaryen-dc73f07807400eb48b8c4bc173bae37f188fc90b.tar.gz
binaryen-dc73f07807400eb48b8c4bc173bae37f188fc90b.tar.bz2
binaryen-dc73f07807400eb48b8c4bc173bae37f188fc90b.zip
[Strings] string.measure (#4775)
Diffstat (limited to 'src/ir/cost.h')
-rw-r--r--src/ir/cost.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ir/cost.h b/src/ir/cost.h
index 2b918bf38..372c597a5 100644
--- a/src/ir/cost.h
+++ b/src/ir/cost.h
@@ -675,6 +675,9 @@ struct CostAnalyzer : public OverriddenVisitor<CostAnalyzer, CostType> {
return 4 + visit(curr->ptr) + visit(curr->length);
}
CostType visitStringConst(StringConst* curr) { return 4; }
+ CostType visitStringMeasure(StringMeasure* curr) {
+ return 6 + visit(curr->ref);
+ }
private:
CostType nullCheckCost(Expression* ref) {