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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes.dart

Issue 693803003: Move continueWithExpression to IrBuilder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comment. Created 6 years, 1 month 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) 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 4
5 // IrNodes are kept in a separate library to have precise control over their 5 // IrNodes are kept in a separate library to have precise control over their
6 // dependencies on other parts of the system. 6 // dependencies on other parts of the system.
7 library dart2js.ir_nodes; 7 library dart2js.ir_nodes;
8 8
9 import '../constants/expressions.dart'; 9 import '../constants/expressions.dart';
10 import '../constants/values.dart' as values show ConstantValue; 10 import '../constants/values.dart' as values show ConstantValue;
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 } 276 }
277 277
278 /// "as" casts and "is" checks. 278 /// "as" casts and "is" checks.
279 // We might want to turn "is"-checks into a [Primitive] as it can never diverge. 279 // We might want to turn "is"-checks into a [Primitive] as it can never diverge.
280 // But then we need to special-case for is-checks with an erroneous .type as 280 // But then we need to special-case for is-checks with an erroneous .type as
281 // these will throw. 281 // these will throw.
282 class TypeOperator extends Expression { 282 class TypeOperator extends Expression {
283 final Reference receiver; 283 final Reference receiver;
284 final DartType type; 284 final DartType type;
285 final Reference continuation; 285 final Reference continuation;
286 final String operator; 286 // TODO(johnniwinther): Use `Operator` class to encapsule the operator type.
287 final bool isTypeTest;
287 288
288 TypeOperator(this.operator, 289 TypeOperator(Primitive receiver,
289 Primitive receiver, 290 this.type,
290 this.type, 291 Continuation cont,
291 Continuation cont) 292 {bool this.isTypeTest})
292 : this.receiver = new Reference(receiver), 293 : this.receiver = new Reference(receiver),
293 this.continuation = new Reference(cont) { 294 this.continuation = new Reference(cont) {
294 assert(operator == "is" || operator == "as"); 295 assert(isTypeTest != null);
295 } 296 }
296 297
298 bool get isTypeCast => !isTypeTest;
299
297 accept(Visitor visitor) => visitor.visitTypeOperator(this); 300 accept(Visitor visitor) => visitor.visitTypeOperator(this);
298 } 301 }
299 302
300 /// Invoke [toString] on each argument and concatenate the results. 303 /// Invoke [toString] on each argument and concatenate the results.
301 class ConcatenateStrings extends Expression { 304 class ConcatenateStrings extends Expression {
302 final Reference continuation; 305 final Reference continuation;
303 final List<Reference> arguments; 306 final List<Reference> arguments;
304 307
305 ConcatenateStrings(Continuation cont, List<Definition> args) 308 ConcatenateStrings(Continuation cont, List<Definition> args)
306 : continuation = new Reference(cont), 309 : continuation = new Reference(cont),
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 release(node.parameters[i]); 945 release(node.parameters[i]);
943 } 946 }
944 } 947 }
945 948
946 void visitIsTrue(IsTrue node) { 949 void visitIsTrue(IsTrue node) {
947 visitReference(node.value); 950 visitReference(node.value);
948 } 951 }
949 952
950 } 953 }
951 954
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698