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.h3
-rw-r--r--src/ir/effects.h4
-rw-r--r--src/ir/possible-contents.cpp4
4 files changed, 12 insertions, 0 deletions
diff --git a/src/ir/ReFinalize.cpp b/src/ir/ReFinalize.cpp
index 8acffaa34..102d701b9 100644
--- a/src/ir/ReFinalize.cpp
+++ b/src/ir/ReFinalize.cpp
@@ -176,6 +176,7 @@ void ReFinalize::visitStringNew(StringNew* curr) { curr->finalize(); }
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::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 afc091ffb..2dcf7c456 100644
--- a/src/ir/cost.h
+++ b/src/ir/cost.h
@@ -681,6 +681,9 @@ struct CostAnalyzer : public OverriddenVisitor<CostAnalyzer, CostType> {
CostType visitStringEncode(StringEncode* curr) {
return 6 + visit(curr->ref) + visit(curr->ptr);
}
+ CostType visitStringConcat(StringConcat* curr) {
+ return 10 + visit(curr->left) + visit(curr->right);
+ }
private:
CostType nullCheckCost(Expression* ref) {
diff --git a/src/ir/effects.h b/src/ir/effects.h
index 8e33f65bf..dbd1bb48f 100644
--- a/src/ir/effects.h
+++ b/src/ir/effects.h
@@ -742,6 +742,10 @@ private:
// traps when ref is null or we write out of bounds.
parent.implicitTrap = true;
}
+ void visitStringConcat(StringConcat* curr) {
+ // traps when an input is null.
+ parent.implicitTrap = true;
+ }
};
public:
diff --git a/src/ir/possible-contents.cpp b/src/ir/possible-contents.cpp
index c865585f1..21eadc50b 100644
--- a/src/ir/possible-contents.cpp
+++ b/src/ir/possible-contents.cpp
@@ -689,6 +689,10 @@ struct InfoCollector
// TODO: optimize when possible
addRoot(curr);
}
+ void visitStringConcat(StringConcat* 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