diff options
author | Thomas Lively <tlively@google.com> | 2024-05-15 12:07:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 12:07:34 -0700 |
commit | 6b43a5ef76149c92e216fddb0a1ee17f736b4b6e (patch) | |
tree | 7b2deb1e6924ba8f74e0b25c26cf2d9a63ad610a /src/ir/cost.h | |
parent | ef4b57c2a491a2193435dccdc9305f6a79965715 (diff) | |
download | binaryen-6b43a5ef76149c92e216fddb0a1ee17f736b4b6e.tar.gz binaryen-6b43a5ef76149c92e216fddb0a1ee17f736b4b6e.tar.bz2 binaryen-6b43a5ef76149c92e216fddb0a1ee17f736b4b6e.zip |
[Strings] Remove operations not included in imported strings (#6589)
The stringref proposal has been superseded by the imported JS strings proposal,
but the former has many more operations than the latter. To reduce complexity,
remove all operations that are part of stringref but not part of imported
strings.
Diffstat (limited to 'src/ir/cost.h')
-rw-r--r-- | src/ir/cost.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ir/cost.h b/src/ir/cost.h index 8af68dbf1..6622561b8 100644 --- a/src/ir/cost.h +++ b/src/ir/cost.h @@ -689,15 +689,15 @@ struct CostAnalyzer : public OverriddenVisitor<CostAnalyzer, CostType> { } CostType visitRefAs(RefAs* curr) { return 1 + visit(curr->value); } CostType visitStringNew(StringNew* curr) { - return 8 + visit(curr->ptr) + maybeVisit(curr->length) + - maybeVisit(curr->start) + maybeVisit(curr->end); + return 8 + visit(curr->ref) + maybeVisit(curr->start) + + maybeVisit(curr->end); } CostType visitStringConst(StringConst* curr) { return 4; } CostType visitStringMeasure(StringMeasure* curr) { return 6 + visit(curr->ref); } CostType visitStringEncode(StringEncode* curr) { - return 6 + visit(curr->ref) + visit(curr->ptr); + return 6 + visit(curr->str) + visit(curr->array) + visit(curr->start); } CostType visitStringConcat(StringConcat* curr) { return 10 + visit(curr->left) + visit(curr->right); |