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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 library dart2js.ir_nodes; 4 library dart2js.ir_nodes;
5 5
6 import '../constants/expressions.dart'; 6 import '../constants/expressions.dart';
7 import '../constants/values.dart' as values show ConstantValue; 7 import '../constants/values.dart' as values show ConstantValue;
8 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType; 8 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType;
9 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
10 import '../io/source_information.dart' show SourceInformation; 10 import '../io/source_information.dart' show SourceInformation;
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 this.type, 429 this.type,
430 List<Primitive> typeArguments, 430 List<Primitive> typeArguments,
431 Continuation cont) 431 Continuation cont)
432 : this.value = new Reference<Primitive>(value), 432 : this.value = new Reference<Primitive>(value),
433 this.typeArguments = _referenceList(typeArguments), 433 this.typeArguments = _referenceList(typeArguments),
434 this.continuation = new Reference<Continuation>(cont); 434 this.continuation = new Reference<Continuation>(cont);
435 435
436 accept(Visitor visitor) => visitor.visitTypeCast(this); 436 accept(Visitor visitor) => visitor.visitTypeCast(this);
437 } 437 }
438 438
439 /// Invoke [toString] on each argument and concatenate the results.
440 class ConcatenateStrings extends Expression {
441 final List<Reference<Primitive>> arguments;
442 final Reference<Continuation> continuation;
443
444 ConcatenateStrings(List<Primitive> args, Continuation cont)
445 : arguments = _referenceList(args),
446 continuation = new Reference<Continuation>(cont);
447
448 accept(Visitor visitor) => visitor.visitConcatenateStrings(this);
449 }
450
439 /// Apply a built-in operator. 451 /// Apply a built-in operator.
440 /// 452 ///
441 /// It must be known that the arguments have the proper types. 453 /// It must be known that the arguments have the proper types.
442 class ApplyBuiltinOperator extends Primitive { 454 class ApplyBuiltinOperator extends Primitive {
443 BuiltinOperator operator; 455 BuiltinOperator operator;
444 List<Reference<Primitive>> arguments; 456 List<Reference<Primitive>> arguments;
445 457
446 ApplyBuiltinOperator(this.operator, List<Primitive> arguments) 458 ApplyBuiltinOperator(this.operator, List<Primitive> arguments)
447 : this.arguments = _referenceList(arguments); 459 : this.arguments = _referenceList(arguments);
448 460
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 ForeignCode(this.codeTemplate, this.type, List<Primitive> arguments, 762 ForeignCode(this.codeTemplate, this.type, List<Primitive> arguments,
751 this.nativeBehavior, {Continuation continuation, this.dependency}) 763 this.nativeBehavior, {Continuation continuation, this.dependency})
752 : arguments = _referenceList(arguments), 764 : arguments = _referenceList(arguments),
753 continuation = continuation == null ? null 765 continuation = continuation == null ? null
754 : new Reference<Continuation>(continuation); 766 : new Reference<Continuation>(continuation);
755 767
756 accept(Visitor visitor) => visitor.visitForeignCode(this); 768 accept(Visitor visitor) => visitor.visitForeignCode(this);
757 } 769 }
758 770
759 class Constant extends Primitive { 771 class Constant extends Primitive {
772 final ConstantExpression expression;
760 final values.ConstantValue value; 773 final values.ConstantValue value;
761 774
762 Constant(this.value); 775 Constant(this.expression, this.value);
763 776
764 accept(Visitor visitor) => visitor.visitConstant(this); 777 accept(Visitor visitor) => visitor.visitConstant(this);
765 } 778 }
766 779
767 class LiteralList extends Primitive { 780 class LiteralList extends Primitive {
768 /// The List type being created; this is not the type argument. 781 /// The List type being created; this is not the type argument.
769 final InterfaceType type; 782 final InterfaceType type;
770 final List<Reference<Primitive>> values; 783 final List<Reference<Primitive>> values;
771 784
772 LiteralList(this.type, List<Primitive> values) 785 LiteralList(this.type, List<Primitive> values)
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 // Expressions. 959 // Expressions.
947 T visitLetPrim(LetPrim node); 960 T visitLetPrim(LetPrim node);
948 T visitLetCont(LetCont node); 961 T visitLetCont(LetCont node);
949 T visitLetHandler(LetHandler node); 962 T visitLetHandler(LetHandler node);
950 T visitLetMutable(LetMutable node); 963 T visitLetMutable(LetMutable node);
951 T visitInvokeContinuation(InvokeContinuation node); 964 T visitInvokeContinuation(InvokeContinuation node);
952 T visitInvokeStatic(InvokeStatic node); 965 T visitInvokeStatic(InvokeStatic node);
953 T visitInvokeMethod(InvokeMethod node); 966 T visitInvokeMethod(InvokeMethod node);
954 T visitInvokeMethodDirectly(InvokeMethodDirectly node); 967 T visitInvokeMethodDirectly(InvokeMethodDirectly node);
955 T visitInvokeConstructor(InvokeConstructor node); 968 T visitInvokeConstructor(InvokeConstructor node);
969 T visitConcatenateStrings(ConcatenateStrings node);
956 T visitThrow(Throw node); 970 T visitThrow(Throw node);
957 T visitRethrow(Rethrow node); 971 T visitRethrow(Rethrow node);
958 T visitBranch(Branch node); 972 T visitBranch(Branch node);
959 T visitTypeCast(TypeCast node); 973 T visitTypeCast(TypeCast node);
960 T visitSetMutableVariable(SetMutableVariable node); 974 T visitSetMutableVariable(SetMutableVariable node);
961 T visitSetStatic(SetStatic node); 975 T visitSetStatic(SetStatic node);
962 T visitGetLazyStatic(GetLazyStatic node); 976 T visitGetLazyStatic(GetLazyStatic node);
963 T visitSetField(SetField node); 977 T visitSetField(SetField node);
964 T visitUnreachable(Unreachable node); 978 T visitUnreachable(Unreachable node);
965 979
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 node.arguments.forEach(processReference); 1086 node.arguments.forEach(processReference);
1073 } 1087 }
1074 1088
1075 processInvokeConstructor(InvokeConstructor node) {} 1089 processInvokeConstructor(InvokeConstructor node) {}
1076 visitInvokeConstructor(InvokeConstructor node) { 1090 visitInvokeConstructor(InvokeConstructor node) {
1077 processInvokeConstructor(node); 1091 processInvokeConstructor(node);
1078 processReference(node.continuation); 1092 processReference(node.continuation);
1079 node.arguments.forEach(processReference); 1093 node.arguments.forEach(processReference);
1080 } 1094 }
1081 1095
1096 processConcatenateStrings(ConcatenateStrings node) {}
1097 visitConcatenateStrings(ConcatenateStrings node) {
1098 processConcatenateStrings(node);
1099 processReference(node.continuation);
1100 node.arguments.forEach(processReference);
1101 }
1102
1082 processThrow(Throw node) {} 1103 processThrow(Throw node) {}
1083 visitThrow(Throw node) { 1104 visitThrow(Throw node) {
1084 processThrow(node); 1105 processThrow(node);
1085 processReference(node.value); 1106 processReference(node.value);
1086 } 1107 }
1087 1108
1088 processRethrow(Rethrow node) {} 1109 processRethrow(Rethrow node) {}
1089 visitRethrow(Rethrow node) { 1110 visitRethrow(Rethrow node) {
1090 processRethrow(node); 1111 processRethrow(node);
1091 } 1112 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 const RemovalVisitor(); 1310 const RemovalVisitor();
1290 1311
1291 processReference(Reference reference) { 1312 processReference(Reference reference) {
1292 reference.unlink(); 1313 reference.unlink();
1293 } 1314 }
1294 1315
1295 static void remove(Node node) { 1316 static void remove(Node node) {
1296 (const RemovalVisitor()).visit(node); 1317 (const RemovalVisitor()).visit(node);
1297 } 1318 }
1298 } 1319 }
OLDNEW
« 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