Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart

Issue 1201753004: Revert "dart2js cps: Refactor and optimize string concatenations." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
index 00f71827f28c571ad84b3c8b53558307fcab3516..5bc5d046b92b73c65dd369f154111892fe7333a9 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -436,6 +436,18 @@ class TypeCast extends Expression {
accept(Visitor visitor) => visitor.visitTypeCast(this);
}
+/// Invoke [toString] on each argument and concatenate the results.
+class ConcatenateStrings extends Expression {
+ final List<Reference<Primitive>> arguments;
+ final Reference<Continuation> continuation;
+
+ ConcatenateStrings(List<Primitive> args, Continuation cont)
+ : arguments = _referenceList(args),
+ continuation = new Reference<Continuation>(cont);
+
+ accept(Visitor visitor) => visitor.visitConcatenateStrings(this);
+}
+
/// Apply a built-in operator.
///
/// It must be known that the arguments have the proper types.
@@ -757,9 +769,10 @@ class ForeignCode extends Expression {
}
class Constant extends Primitive {
+ final ConstantExpression expression;
final values.ConstantValue value;
- Constant(this.value);
+ Constant(this.expression, this.value);
accept(Visitor visitor) => visitor.visitConstant(this);
}
@@ -953,6 +966,7 @@ abstract class Visitor<T> {
T visitInvokeMethod(InvokeMethod node);
T visitInvokeMethodDirectly(InvokeMethodDirectly node);
T visitInvokeConstructor(InvokeConstructor node);
+ T visitConcatenateStrings(ConcatenateStrings node);
T visitThrow(Throw node);
T visitRethrow(Rethrow node);
T visitBranch(Branch node);
@@ -1079,6 +1093,13 @@ class RecursiveVisitor implements Visitor {
node.arguments.forEach(processReference);
}
+ processConcatenateStrings(ConcatenateStrings node) {}
+ visitConcatenateStrings(ConcatenateStrings node) {
+ processConcatenateStrings(node);
+ processReference(node.continuation);
+ node.arguments.forEach(processReference);
+ }
+
processThrow(Throw node) {}
visitThrow(Throw node) {
processThrow(node);
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698