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

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

Issue 11412245: MalformedType used for all invalid type annotations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Bug fixes 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 class BailoutInfo { 7 class BailoutInfo {
8 int instructionId; 8 int instructionId;
9 int bailoutId; 9 int bailoutId;
10 BailoutInfo(this.instructionId, this.bailoutId); 10 BailoutInfo(this.instructionId, this.bailoutId);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 HType speculativeType) { 105 HType speculativeType) {
106 // If the type itself is not valuable, do not generate a guard for it. 106 // If the type itself is not valuable, do not generate a guard for it.
107 if (!typeValuable(speculativeType)) return false; 107 if (!typeValuable(speculativeType)) return false;
108 108
109 // Do not insert a type guard if the instruction has a type 109 // Do not insert a type guard if the instruction has a type
110 // annotation that disagrees with the speculated type. 110 // annotation that disagrees with the speculated type.
111 Element source = instruction.sourceElement; 111 Element source = instruction.sourceElement;
112 if (source != null) { 112 if (source != null) {
113 DartType sourceType = source.computeType(compiler); 113 DartType sourceType = source.computeType(compiler);
114 DartType speculatedType = speculativeType.computeType(compiler); 114 DartType speculatedType = speculativeType.computeType(compiler);
115 if (speculatedType != null 115 if (speculatedType != null &&
116 && !compiler.types.isAssignable(speculatedType, sourceType)) { 116 !speculatedType.isMalformed &&
117 !sourceType.isMalformed &&
118 !compiler.types.isAssignable(speculatedType, sourceType)) {
117 return false; 119 return false;
118 } 120 }
119 } 121 }
120 122
121 // Insert type guards for recursive methods. 123 // Insert type guards for recursive methods.
122 if (isRecursiveMethod) return true; 124 if (isRecursiveMethod) return true;
123 125
124 // Insert type guards if there are uses in loops. 126 // Insert type guards if there are uses in loops.
125 bool isNested(HBasicBlock inner, HBasicBlock outer) { 127 bool isNested(HBasicBlock inner, HBasicBlock outer) {
126 if (identical(inner, outer)) return false; 128 if (identical(inner, outer)) return false;
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 hasComplexBailoutTargets = true; 541 hasComplexBailoutTargets = true;
540 } 542 }
541 } else { 543 } else {
542 hasComplexBailoutTargets = true; 544 hasComplexBailoutTargets = true;
543 blocks.forEach((HBasicBlock block) { 545 blocks.forEach((HBasicBlock block) {
544 block.bailoutTargets.add(target); 546 block.bailoutTargets.add(target);
545 }); 547 });
546 } 548 }
547 } 549 }
548 } 550 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698