| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of ssa; | 5 part of ssa; |
| 6 | 6 |
| 7 abstract class OptimizationPhase { | 7 abstract class OptimizationPhase { |
| 8 String get name; | 8 String get name; |
| 9 void visitGraph(HGraph graph); | 9 void visitGraph(HGraph graph); |
| 10 } | 10 } |
| (...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1501 } | 1501 } |
| 1502 } | 1502 } |
| 1503 } | 1503 } |
| 1504 | 1504 |
| 1505 if (ifUsers.isEmpty && notIfUsers.isEmpty) return; | 1505 if (ifUsers.isEmpty && notIfUsers.isEmpty) return; |
| 1506 | 1506 |
| 1507 TypeMask convertedType = new TypeMask.nonNullSubtype(element); | 1507 TypeMask convertedType = new TypeMask.nonNullSubtype(element); |
| 1508 HInstruction input = instruction.expression; | 1508 HInstruction input = instruction.expression; |
| 1509 for (HIf ifUser in ifUsers) { | 1509 for (HIf ifUser in ifUsers) { |
| 1510 changeUsesDominatedBy(ifUser.thenBlock, input, convertedType); | 1510 changeUsesDominatedBy(ifUser.thenBlock, input, convertedType); |
| 1511 // TODO(ngeoffray): Also change uses for the else block on a HType | 1511 // TODO(ngeoffray): Also change uses for the else block on a type |
| 1512 // that knows it is not of a specific Type. | 1512 // that knows it is not of a specific type. |
| 1513 } | 1513 } |
| 1514 | 1514 |
| 1515 for (HIf ifUser in notIfUsers) { | 1515 for (HIf ifUser in notIfUsers) { |
| 1516 changeUsesDominatedBy(ifUser.elseBlock, input, convertedType); | 1516 changeUsesDominatedBy(ifUser.elseBlock, input, convertedType); |
| 1517 // TODO(ngeoffray): Also change uses for the then block on a HType | 1517 // TODO(ngeoffray): Also change uses for the then block on a type |
| 1518 // that knows it is not of a specific Type. | 1518 // that knows it is not of a specific type. |
| 1519 } | 1519 } |
| 1520 } | 1520 } |
| 1521 } | 1521 } |
| OLD | NEW |