Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 11412245: MalformedType used for all invalid type annotations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698