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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart

Issue 870353004: cps-ir: Implement string concatenation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 4
5 library tree_ir_nodes; 5 library tree_ir_nodes;
6 6
7 import '../constants/expressions.dart'; 7 import '../constants/expressions.dart';
8 import '../constants/values.dart' as values; 8 import '../constants/values.dart' as values;
9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir;
10 import '../dart_types.dart' show DartType, GenericType; 10 import '../dart_types.dart' show DartType, GenericType;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 /** 177 /**
178 * Call to a factory or generative constructor. 178 * Call to a factory or generative constructor.
179 */ 179 */
180 class InvokeConstructor extends Expression implements Invoke { 180 class InvokeConstructor extends Expression implements Invoke {
181 final DartType type; 181 final DartType type;
182 final FunctionElement target; 182 final FunctionElement target;
183 final List<Expression> arguments; 183 final List<Expression> arguments;
184 final Selector selector; 184 final Selector selector;
185 /// TODO(karlklose): get rid of this field. Instead use the constant's
186 /// expression to find the constructor to be called in dart2dart.
185 final values.ConstantValue constant; 187 final values.ConstantValue constant;
186 188
187 InvokeConstructor(this.type, this.target, this.selector, this.arguments, 189 InvokeConstructor(this.type, this.target, this.selector, this.arguments,
188 [this.constant]); 190 [this.constant]);
189 191
190 ClassElement get targetClass => target.enclosingElement; 192 ClassElement get targetClass => target.enclosingElement;
191 193
192 accept(ExpressionVisitor visitor) => visitor.visitInvokeConstructor(this); 194 accept(ExpressionVisitor visitor) => visitor.visitInvokeConstructor(this);
193 accept1(ExpressionVisitor1 visitor, arg) { 195 accept1(ExpressionVisitor1 visitor, arg) {
194 return visitor.visitInvokeConstructor(this, arg); 196 return visitor.visitInvokeConstructor(this, arg);
195 } 197 }
196 } 198 }
197 199
198 /// Calls [toString] on each argument and concatenates the results. 200 /// Calls [toString] on each argument and concatenates the results.
199 class ConcatenateStrings extends Expression { 201 class ConcatenateStrings extends Expression {
200 final List<Expression> arguments; 202 final List<Expression> arguments;
201 final values.ConstantValue constant;
202 203
203 ConcatenateStrings(this.arguments, [this.constant]); 204 ConcatenateStrings(this.arguments);
204 205
205 accept(ExpressionVisitor visitor) => visitor.visitConcatenateStrings(this); 206 accept(ExpressionVisitor visitor) => visitor.visitConcatenateStrings(this);
206 accept1(ExpressionVisitor1 visitor, arg) { 207 accept1(ExpressionVisitor1 visitor, arg) {
207 return visitor.visitConcatenateStrings(this, arg); 208 return visitor.visitConcatenateStrings(this, arg);
208 } 209 }
209 } 210 }
210 211
211 /** 212 /**
212 * A constant. 213 * A constant.
213 */ 214 */
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 visitStatement(node.next); 920 visitStatement(node.next);
920 } 921 }
921 922
922 visitCreateBox(CreateBox node) { 923 visitCreateBox(CreateBox node) {
923 } 924 }
924 925
925 visitCreateInstance(CreateInstance node) { 926 visitCreateInstance(CreateInstance node) {
926 node.arguments.forEach(visitExpression); 927 node.arguments.forEach(visitExpression);
927 } 928 }
928 } 929 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698