summaryrefslogtreecommitdiff
path: root/src/ir
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir')
-rw-r--r--src/ir/ReFinalize.cpp1
-rw-r--r--src/ir/cost.h4
-rw-r--r--src/ir/effects.h1
-rw-r--r--src/ir/possible-contents.cpp4
4 files changed, 10 insertions, 0 deletions
diff --git a/src/ir/ReFinalize.cpp b/src/ir/ReFinalize.cpp
index 102d701b9..f509ab261 100644
--- a/src/ir/ReFinalize.cpp
+++ b/src/ir/ReFinalize.cpp
@@ -177,6 +177,7 @@ void ReFinalize::visitStringConst(StringConst* curr) { curr->finalize(); }
void ReFinalize::visitStringMeasure(StringMeasure* curr) { curr->finalize(); }
void ReFinalize::visitStringEncode(StringEncode* curr) { curr->finalize(); }
void ReFinalize::visitStringConcat(StringConcat* curr) { curr->finalize(); }
+void ReFinalize::visitStringEq(StringEq* curr) { curr->finalize(); }
void ReFinalize::visitFunction(Function* curr) {
// we may have changed the body from unreachable to none, which might be bad
diff --git a/src/ir/cost.h b/src/ir/cost.h
index 2dcf7c456..ea07e6109 100644
--- a/src/ir/cost.h
+++ b/src/ir/cost.h
@@ -684,6 +684,10 @@ struct CostAnalyzer : public OverriddenVisitor<CostAnalyzer, CostType> {
CostType visitStringConcat(StringConcat* curr) {
return 10 + visit(curr->left) + visit(curr->right);
}
+ CostType visitStringEq(StringEq* curr) {
+ // "3" is chosen since strings might or might not be interned in the engine.
+ return 3 + visit(curr->left) + visit(curr->right);
+ }
private:
CostType nullCheckCost(Expression* ref) {
diff --git a/src/ir/effects.h b/src/ir/effects.h
index dbd1bb48f..0dd0902b1 100644
--- a/src/ir/effects.h
+++ b/src/ir/effects.h
@@ -746,6 +746,7 @@ private:
// traps when an input is null.
parent.implicitTrap = true;
}
+ void visitStringEq(StringEq* curr) {}
};
public:
diff --git a/src/ir/possible-contents.cpp b/src/ir/possible-contents.cpp
index 21eadc50b..7db493f00 100644
--- a/src/ir/possible-contents.cpp
+++ b/src/ir/possible-contents.cpp
@@ -693,6 +693,10 @@ struct InfoCollector
// TODO: optimize when possible
addRoot(curr);
}
+ void visitStringEq(StringEq* curr) {
+ // TODO: optimize when possible
+ addRoot(curr);
+ }
// TODO: Model which throws can go to which catches. For now, anything thrown
// is sent to the location of that tag, and any catch of that tag can