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

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

Issue 11543017: Revert r16032: it revealed a bug in our bailout environment computation. (Closed) Base URL: http://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 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 return false; 132 return false;
133 } 133 }
134 134
135 // If the instruction is not in a loop then the header will be null. 135 // If the instruction is not in a loop then the header will be null.
136 HBasicBlock currentLoopHeader = instruction.block.enclosingLoopHeader; 136 HBasicBlock currentLoopHeader = instruction.block.enclosingLoopHeader;
137 for (HInstruction user in instruction.usedBy) { 137 for (HInstruction user in instruction.usedBy) {
138 HBasicBlock userLoopHeader = user.block.enclosingLoopHeader; 138 HBasicBlock userLoopHeader = user.block.enclosingLoopHeader;
139 if (isNested(userLoopHeader, currentLoopHeader)) return true; 139 if (isNested(userLoopHeader, currentLoopHeader)) return true;
140 } 140 }
141 141
142 bool isIndexOperatorOnIndexablePrimitive(instruction, types) {
143 return instruction is HIndex
144 || (instruction is HInvokeDynamicMethod
145 && instruction.isIndexOperatorOnIndexablePrimitive(types));
146 }
147
148 // To speed up computations on values loaded from arrays, we 142 // To speed up computations on values loaded from arrays, we
149 // insert type guards for builtin array indexing operations in 143 // insert type guards for builtin array indexing operations in
150 // nested loops. Since this can blow up code size quite 144 // nested loops. Since this can blow up code size quite
151 // significantly, we only do it if type guards have already been 145 // significantly, we only do it if type guards have already been
152 // inserted for this method. The code size price for an additional 146 // inserted for this method. The code size price for an additional
153 // type guard is much smaller than the first one that causes the 147 // type guard is much smaller than the first one that causes the
154 // generation of a bailout method. 148 // generation of a bailout method.
155 if (hasTypeGuards 149 if (instruction is HIndex &&
156 && isIndexOperatorOnIndexablePrimitive(instruction, types)) { 150 (instruction as HIndex).isBuiltin(types) &&
151 hasTypeGuards) {
157 HBasicBlock loopHeader = instruction.block.enclosingLoopHeader; 152 HBasicBlock loopHeader = instruction.block.enclosingLoopHeader;
158 if (loopHeader != null && loopHeader.parentLoopHeader != null) { 153 if (loopHeader != null && loopHeader.parentLoopHeader != null) {
159 return true; 154 return true;
160 } 155 }
161 } 156 }
162 157
163 // If the instruction is used by a phi where a guard would be 158 // If the instruction is used by a phi where a guard would be
164 // valuable, put the guard on that instruction. 159 // valuable, put the guard on that instruction.
165 for (HInstruction user in instruction.usedBy) { 160 for (HInstruction user in instruction.usedBy) {
166 if (user is HPhi 161 if (user is HPhi
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 hasComplexBailoutTargets = true; 539 hasComplexBailoutTargets = true;
545 } 540 }
546 } else { 541 } else {
547 hasComplexBailoutTargets = true; 542 hasComplexBailoutTargets = true;
548 blocks.forEach((HBasicBlock block) { 543 blocks.forEach((HBasicBlock block) {
549 block.bailoutTargets.add(target); 544 block.bailoutTargets.add(target);
550 }); 545 });
551 } 546 }
552 } 547 }
553 } 548 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698