| 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.optimization.logical_rewriter; | 5 library tree_ir.optimization.logical_rewriter; |
| 6 | 6 |
| 7 import '../../constants/values.dart' as values; |
| 7 import '../tree_ir_nodes.dart'; | 8 import '../tree_ir_nodes.dart'; |
| 8 import 'optimization.dart' show Pass; | 9 import 'optimization.dart' show Pass; |
| 9 import '../../constants/values.dart' as values; | |
| 10 | 10 |
| 11 /// Rewrites logical expressions to be more compact in the Tree IR. | 11 /// Rewrites logical expressions to be more compact in the Tree IR. |
| 12 /// | 12 /// |
| 13 /// In this class an expression is said to occur in "boolean context" if | 13 /// In this class an expression is said to occur in "boolean context" if |
| 14 /// its result is immediately applied to boolean conversion. | 14 /// its result is immediately applied to boolean conversion. |
| 15 /// | 15 /// |
| 16 /// IF STATEMENTS: | 16 /// IF STATEMENTS: |
| 17 /// | 17 /// |
| 18 /// We apply the following two rules to [If] statements (see [visitIf]). | 18 /// We apply the following two rules to [If] statements (see [visitIf]). |
| 19 /// | 19 /// |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 } else if (e1 is Assign) { | 557 } else if (e1 is Assign) { |
| 558 return e2 is VariableUse && e1.variable == e2.variable; | 558 return e2 is VariableUse && e1.variable == e2.variable; |
| 559 } | 559 } |
| 560 return false; | 560 return false; |
| 561 } | 561 } |
| 562 | 562 |
| 563 void destroyVariableUse(VariableUse node) { | 563 void destroyVariableUse(VariableUse node) { |
| 564 --node.variable.readCount; | 564 --node.variable.readCount; |
| 565 } | 565 } |
| 566 } | 566 } |
| OLD | NEW |