| 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.statement_rewriter; | 5 library tree_ir.optimization.statement_rewriter; |
| 6 | 6 |
| 7 import '../../elements/elements.dart'; |
| 8 import '../../io/source_information.dart'; |
| 9 import '../../js/placeholder_safety.dart'; |
| 10 import '../tree_ir_nodes.dart'; |
| 7 import 'optimization.dart' show Pass; | 11 import 'optimization.dart' show Pass; |
| 8 import '../tree_ir_nodes.dart'; | |
| 9 import '../../io/source_information.dart'; | |
| 10 import '../../elements/elements.dart'; | |
| 11 import '../../js/placeholder_safety.dart'; | |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * Translates to direct-style. | 14 * Translates to direct-style. |
| 15 * | 15 * |
| 16 * In addition to the general IR constraints (see [CheckTreeIntegrity]), | 16 * In addition to the general IR constraints (see [CheckTreeIntegrity]), |
| 17 * the input is assumed to satisfy the following criteria: | 17 * the input is assumed to satisfy the following criteria: |
| 18 * | 18 * |
| 19 * All expressions other than those nested in [Assign] or [ExpressionStatement] | 19 * All expressions other than those nested in [Assign] or [ExpressionStatement] |
| 20 * must be simple. A [VariableUse] and [This] is a simple expression. | 20 * must be simple. A [VariableUse] and [This] is a simple expression. |
| 21 * The right-hand of an [Assign] may not be an [Assign]. | 21 * The right-hand of an [Assign] may not be an [Assign]. |
| (...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1382 } | 1382 } |
| 1383 | 1383 |
| 1384 /// Decrement the reference count for [e] if it is a variable use. | 1384 /// Decrement the reference count for [e] if it is a variable use. |
| 1385 void destroyPrimaryExpression(Expression e) { | 1385 void destroyPrimaryExpression(Expression e) { |
| 1386 if (e is VariableUse) { | 1386 if (e is VariableUse) { |
| 1387 --e.variable.readCount; | 1387 --e.variable.readCount; |
| 1388 } else { | 1388 } else { |
| 1389 assert(e is This); | 1389 assert(e is This); |
| 1390 } | 1390 } |
| 1391 } | 1391 } |
| OLD | NEW |