| OLD | NEW |
| 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/values.dart' as values; | 7 import '../constants/values.dart' as values; |
| 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; |
| 11 import '../types/types.dart' show TypeMask; | 11 import '../types/types.dart' show TypeMask; |
| 12 import '../universe/universe.dart' show Selector; | 12 import '../universe/selector.dart' show Selector; |
| 13 | 13 |
| 14 import '../cps_ir/builtin_operator.dart'; | 14 import '../cps_ir/builtin_operator.dart'; |
| 15 export '../cps_ir/builtin_operator.dart'; | 15 export '../cps_ir/builtin_operator.dart'; |
| 16 | 16 |
| 17 // These imports are only used for the JavaScript specific nodes. If we want to | 17 // These imports are only used for the JavaScript specific nodes. If we want to |
| 18 // support more than one native backend, we should probably create better | 18 // support more than one native backend, we should probably create better |
| 19 // abstractions for native code and its type and effect system. | 19 // abstractions for native code and its type and effect system. |
| 20 import '../js/js.dart' as js show Template; | 20 import '../js/js.dart' as js show Template; |
| 21 import '../native/native.dart' as native show NativeBehavior; | 21 import '../native/native.dart' as native show NativeBehavior; |
| 22 import '../types/types.dart' as types show TypeMask; | 22 import '../types/types.dart' as types show TypeMask; |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 | 367 |
| 368 class ApplyBuiltinMethod extends Expression { | 368 class ApplyBuiltinMethod extends Expression { |
| 369 BuiltinMethod method; | 369 BuiltinMethod method; |
| 370 Expression receiver; | 370 Expression receiver; |
| 371 List<Expression> arguments; | 371 List<Expression> arguments; |
| 372 | 372 |
| 373 bool receiverIsNotNull; | 373 bool receiverIsNotNull; |
| 374 | 374 |
| 375 ApplyBuiltinMethod(this.method, | 375 ApplyBuiltinMethod(this.method, |
| 376 this.receiver, | 376 this.receiver, |
| 377 this.arguments, | 377 this.arguments, |
| 378 {this.receiverIsNotNull: false}); | 378 {this.receiverIsNotNull: false}); |
| 379 | 379 |
| 380 accept(ExpressionVisitor visitor) { | 380 accept(ExpressionVisitor visitor) { |
| 381 return visitor.visitApplyBuiltinMethod(this); | 381 return visitor.visitApplyBuiltinMethod(this); |
| 382 } | 382 } |
| 383 accept1(ExpressionVisitor1 visitor, arg) { | 383 accept1(ExpressionVisitor1 visitor, arg) { |
| 384 return visitor.visitApplyBuiltinMethod(this, arg); | 384 return visitor.visitApplyBuiltinMethod(this, arg); |
| 385 } | 385 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 Statement get next => null; | 494 Statement get next => null; |
| 495 void set next(Statement s) => throw 'UNREACHABLE'; | 495 void set next(Statement s) => throw 'UNREACHABLE'; |
| 496 | 496 |
| 497 accept(StatementVisitor visitor) => visitor.visitWhileTrue(this); | 497 accept(StatementVisitor visitor) => visitor.visitWhileTrue(this); |
| 498 accept1(StatementVisitor1 visitor, arg) => visitor.visitWhileTrue(this, arg); | 498 accept1(StatementVisitor1 visitor, arg) => visitor.visitWhileTrue(this, arg); |
| 499 } | 499 } |
| 500 | 500 |
| 501 /** | 501 /** |
| 502 * A loop with a condition and update expressions. If there are any update | 502 * A loop with a condition and update expressions. If there are any update |
| 503 * expressions, this generates a for loop, otherwise a while loop. | 503 * expressions, this generates a for loop, otherwise a while loop. |
| 504 * | 504 * |
| 505 * When the condition is false, control resumes at the [next] statement. | 505 * When the condition is false, control resumes at the [next] statement. |
| 506 * | 506 * |
| 507 * It is NOT valid to target this statement with a [Break]. | 507 * It is NOT valid to target this statement with a [Break]. |
| 508 * The only way to reach [next] is for the condition to evaluate to false. | 508 * The only way to reach [next] is for the condition to evaluate to false. |
| 509 * | 509 * |
| 510 * [For] statements are introduced in the [LoopRewriter] and are | 510 * [For] statements are introduced in the [LoopRewriter] and are |
| 511 * assumed not to occur before then. | 511 * assumed not to occur before then. |
| 512 */ | 512 */ |
| 513 class For extends Loop { | 513 class For extends Loop { |
| 514 final Label label; | 514 final Label label; |
| (...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1537 | 1537 |
| 1538 /// Number of uses of the current fallthrough target. | 1538 /// Number of uses of the current fallthrough target. |
| 1539 int get useCount => _stack.last.useCount; | 1539 int get useCount => _stack.last.useCount; |
| 1540 | 1540 |
| 1541 /// Indicate that a statement will fall through to the current fallthrough | 1541 /// Indicate that a statement will fall through to the current fallthrough |
| 1542 /// target. | 1542 /// target. |
| 1543 void use() { | 1543 void use() { |
| 1544 ++_stack.last.useCount; | 1544 ++_stack.last.useCount; |
| 1545 } | 1545 } |
| 1546 } | 1546 } |
| OLD | NEW |