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

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

Issue 19097003: Support new malformed types semantics. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix unittests. Created 7 years, 4 months 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 bool typeGuardWouldBeValuable(HInstruction instruction, 134 bool typeGuardWouldBeValuable(HInstruction instruction,
135 HType speculativeType) { 135 HType speculativeType) {
136 // If the type itself is not valuable, do not generate a guard for it. 136 // If the type itself is not valuable, do not generate a guard for it.
137 if (!typeValuable(speculativeType)) return false; 137 if (!typeValuable(speculativeType)) return false;
138 138
139 // Do not insert a type guard if the instruction has a type 139 // Do not insert a type guard if the instruction has a type
140 // annotation that disagrees with the speculated type. 140 // annotation that disagrees with the speculated type.
141 Element source = instruction.sourceElement; 141 Element source = instruction.sourceElement;
142 if (source != null) { 142 if (source != null) {
143 DartType sourceType = source.computeType(compiler); 143 DartType sourceType = source.computeType(compiler);
144 if (!sourceType.isMalformed && !sourceType.isDynamic && 144 if (!sourceType.treatAsDynamic &&
145 sourceType.kind == TypeKind.INTERFACE) { 145 sourceType.kind == TypeKind.INTERFACE) {
146 TypeMask sourceMask = new TypeMask.subtype(sourceType); 146 TypeMask sourceMask = new TypeMask.subtype(sourceType);
147 TypeMask speculatedMask = speculativeType.computeMask(compiler); 147 TypeMask speculatedMask = speculativeType.computeMask(compiler);
148 if (sourceMask.intersection(speculatedMask, compiler).isEmpty) { 148 if (sourceMask.intersection(speculatedMask, compiler).isEmpty) {
149 return false; 149 return false;
150 } 150 }
151 } 151 }
152 } 152 }
153 153
154 // Do not insert a type guard if one of the calls on it will hit 154 // Do not insert a type guard if one of the calls on it will hit
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 hasComplexBailoutTargets = true; 700 hasComplexBailoutTargets = true;
701 } 701 }
702 } else { 702 } else {
703 hasComplexBailoutTargets = true; 703 hasComplexBailoutTargets = true;
704 blocks.forEach((HBasicBlock block) { 704 blocks.forEach((HBasicBlock block) {
705 block.bailoutTargets.add(target); 705 block.bailoutTargets.add(target);
706 }); 706 });
707 } 707 }
708 } 708 }
709 } 709 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698