| 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 } else if (expressionType.isArray()) { | 512 } else if (expressionType.isArray()) { |
| 513 if (identical(element, compiler.listClass) | 513 if (identical(element, compiler.listClass) |
| 514 || Elements.isListSupertype(element, compiler)) { | 514 || Elements.isListSupertype(element, compiler)) { |
| 515 return graph.addConstantBool(true, constantSystem); | 515 return graph.addConstantBool(true, constantSystem); |
| 516 } else { | 516 } else { |
| 517 return graph.addConstantBool(false, constantSystem); | 517 return graph.addConstantBool(false, constantSystem); |
| 518 } | 518 } |
| 519 // TODO(karlklose): remove the hasTypeArguments check. | 519 // TODO(karlklose): remove the hasTypeArguments check. |
| 520 } else if (expressionType.isUseful() | 520 } else if (expressionType.isUseful() |
| 521 && !expressionType.canBeNull() | 521 && !expressionType.canBeNull() |
| 522 && !backend.rti.hasTypeArguments(type)) { | 522 && !RuntimeTypeInformation.hasTypeArguments(type)) { |
| 523 DartType receiverType = expressionType.computeType(compiler); | 523 DartType receiverType = expressionType.computeType(compiler); |
| 524 if (receiverType != null) { | 524 if (receiverType != null) { |
| 525 if (compiler.types.isSubtype(receiverType, type)) { | 525 if (compiler.types.isSubtype(receiverType, type)) { |
| 526 return graph.addConstantBool(true, constantSystem); | 526 return graph.addConstantBool(true, constantSystem); |
| 527 } else if (expressionType.isExact()) { | 527 } else if (expressionType.isExact()) { |
| 528 return graph.addConstantBool(false, constantSystem); | 528 return graph.addConstantBool(false, constantSystem); |
| 529 } | 529 } |
| 530 } | 530 } |
| 531 } | 531 } |
| 532 return node; | 532 return node; |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 } | 1358 } |
| 1359 | 1359 |
| 1360 // For other fields having setters in the generative constructor body, set | 1360 // For other fields having setters in the generative constructor body, set |
| 1361 // the type to UNKNOWN to avoid relying on the type set in the initializer | 1361 // the type to UNKNOWN to avoid relying on the type set in the initializer |
| 1362 // list. | 1362 // list. |
| 1363 allSetters.forEach((Element element) { | 1363 allSetters.forEach((Element element) { |
| 1364 backend.registerFieldConstructor(element, HType.UNKNOWN); | 1364 backend.registerFieldConstructor(element, HType.UNKNOWN); |
| 1365 }); | 1365 }); |
| 1366 } | 1366 } |
| 1367 } | 1367 } |
| OLD | NEW |