| 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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 return graph.addConstantBool(true, constantSystem); | 556 return graph.addConstantBool(true, constantSystem); |
| 557 } else if (expressionType.isExact()) { | 557 } else if (expressionType.isExact()) { |
| 558 return graph.addConstantBool(false, constantSystem); | 558 return graph.addConstantBool(false, constantSystem); |
| 559 } | 559 } |
| 560 } | 560 } |
| 561 } | 561 } |
| 562 return node; | 562 return node; |
| 563 } | 563 } |
| 564 | 564 |
| 565 HInstruction visitTypeConversion(HTypeConversion node) { | 565 HInstruction visitTypeConversion(HTypeConversion node) { |
| 566 // TODO(kasperl): This needs cleaning up. We shouldn't be creating |
| 567 // HType objects for malformed types. |
| 568 if (node.isMalformedCheckedModeCheck) return node; |
| 566 HInstruction value = node.inputs[0]; | 569 HInstruction value = node.inputs[0]; |
| 567 DartType type = node.instructionType.computeType(compiler); | 570 DartType type = node.instructionType.computeType(compiler); |
| 568 if (identical(type.element, compiler.dynamicClass) | 571 if (identical(type.element, compiler.dynamicClass) |
| 569 || identical(type.element, compiler.objectClass)) { | 572 || identical(type.element, compiler.objectClass)) { |
| 570 return value; | 573 return value; |
| 571 } | 574 } |
| 572 if (value.instructionType.canBeNull() && node.isBooleanConversionCheck) { | 575 if (value.instructionType.canBeNull() && node.isBooleanConversionCheck) { |
| 573 return node; | 576 return node; |
| 574 } | 577 } |
| 575 HType combinedType = | 578 HType combinedType = |
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1546 HBasicBlock block = user.block; | 1549 HBasicBlock block = user.block; |
| 1547 block.addAfter(user, interceptor); | 1550 block.addAfter(user, interceptor); |
| 1548 block.rewrite(user, interceptor); | 1551 block.rewrite(user, interceptor); |
| 1549 block.remove(user); | 1552 block.remove(user); |
| 1550 | 1553 |
| 1551 // The interceptor will be removed in the dead code elimination | 1554 // The interceptor will be removed in the dead code elimination |
| 1552 // phase. Note that removing it here would not work because of how | 1555 // phase. Note that removing it here would not work because of how |
| 1553 // the [visitBasicBlock] is implemented. | 1556 // the [visitBasicBlock] is implemented. |
| 1554 } | 1557 } |
| 1555 } | 1558 } |
| OLD | NEW |