| 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 return graph.addConstantBool(true, constantSystem); | 564 return graph.addConstantBool(true, constantSystem); |
| 565 } else { | 565 } else { |
| 566 return graph.addConstantBool(false, constantSystem); | 566 return graph.addConstantBool(false, constantSystem); |
| 567 } | 567 } |
| 568 // TODO(karlklose): remove the hasTypeArguments check. | 568 // TODO(karlklose): remove the hasTypeArguments check. |
| 569 } else if (expressionType.isUseful() | 569 } else if (expressionType.isUseful() |
| 570 && !expressionType.canBeNull() | 570 && !expressionType.canBeNull() |
| 571 && !RuntimeTypeInformation.hasTypeArguments(type)) { | 571 && !RuntimeTypeInformation.hasTypeArguments(type)) { |
| 572 DartType receiverType = expressionType.computeType(compiler); | 572 DartType receiverType = expressionType.computeType(compiler); |
| 573 if (receiverType != null) { | 573 if (receiverType != null) { |
| 574 if (compiler.types.isSubtype(receiverType, type)) { | 574 if (!receiverType.isMalformed && |
| 575 !type.isMalformed && |
| 576 compiler.types.isSubtype(receiverType, type)) { |
| 575 return graph.addConstantBool(true, constantSystem); | 577 return graph.addConstantBool(true, constantSystem); |
| 576 } else if (expressionType.isExact()) { | 578 } else if (expressionType.isExact()) { |
| 577 return graph.addConstantBool(false, constantSystem); | 579 return graph.addConstantBool(false, constantSystem); |
| 578 } | 580 } |
| 579 } | 581 } |
| 580 } | 582 } |
| 581 return node; | 583 return node; |
| 582 } | 584 } |
| 583 | 585 |
| 584 HInstruction visitTypeConversion(HTypeConversion node) { | 586 HInstruction visitTypeConversion(HTypeConversion node) { |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1475 HInstruction receiver = interceptor.receiver; | 1477 HInstruction receiver = interceptor.receiver; |
| 1476 for (var user in receiver.usedBy) { | 1478 for (var user in receiver.usedBy) { |
| 1477 if (user is HInterceptor && interceptor.dominates(user)) { | 1479 if (user is HInterceptor && interceptor.dominates(user)) { |
| 1478 user.interceptedClasses = interceptor.interceptedClasses; | 1480 user.interceptedClasses = interceptor.interceptedClasses; |
| 1479 } | 1481 } |
| 1480 } | 1482 } |
| 1481 } | 1483 } |
| 1482 | 1484 |
| 1483 // TODO(ngeoffray): Also implement it for non-intercepted calls. | 1485 // TODO(ngeoffray): Also implement it for non-intercepted calls. |
| 1484 } | 1486 } |
| OLD | NEW |