Chromium Code Reviews| 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/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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 486 * An assignments of an [Expression] to a [Variable]. | 486 * An assignments of an [Expression] to a [Variable]. |
| 487 * | 487 * |
| 488 * In contrast to the CPS-based IR, non-primitive expressions can be assigned | 488 * In contrast to the CPS-based IR, non-primitive expressions can be assigned |
| 489 * to variables. | 489 * to variables. |
| 490 */ | 490 */ |
| 491 class Assign extends Statement { | 491 class Assign extends Statement { |
| 492 Statement next; | 492 Statement next; |
| 493 Variable variable; | 493 Variable variable; |
| 494 Expression definition; | 494 Expression definition; |
| 495 | 495 |
| 496 /// If true, this declares a new copy of the closure variable. | 496 /// If true, this declares a new copy of the closure variable. |
|
asgerf
2015/02/03 10:27:31
"closure variable" -> "variable"
Kevin Millikin (Google)
2015/02/03 14:11:49
Done. Actually, the second part of the comment do
| |
| 497 /// The consequences are similar to [cps_ir.SetClosureVariable]. | 497 /// The consequences are similar to [cps_ir.SetMutableVariable]. |
| 498 /// All uses of the variable must be nested inside the [next] statement. | 498 /// All uses of the variable must be nested inside the [next] statement. |
| 499 bool isDeclaration; | 499 bool isDeclaration; |
| 500 | 500 |
| 501 Assign(this.variable, this.definition, this.next, | 501 Assign(this.variable, this.definition, this.next, |
| 502 { this.isDeclaration: false }) { | 502 { this.isDeclaration: false }) { |
| 503 variable.writeCount++; | 503 variable.writeCount++; |
| 504 } | 504 } |
| 505 | 505 |
| 506 bool get hasExactlyOneUse => variable.readCount == 1; | 506 bool get hasExactlyOneUse => variable.readCount == 1; |
| 507 | 507 |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 920 visitStatement(node.next); | 920 visitStatement(node.next); |
| 921 } | 921 } |
| 922 | 922 |
| 923 visitCreateBox(CreateBox node) { | 923 visitCreateBox(CreateBox node) { |
| 924 } | 924 } |
| 925 | 925 |
| 926 visitCreateInstance(CreateInstance node) { | 926 visitCreateInstance(CreateInstance node) { |
| 927 node.arguments.forEach(visitExpression); | 927 node.arguments.forEach(visitExpression); |
| 928 } | 928 } |
| 929 } | 929 } |
| OLD | NEW |