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

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

Issue 10116023: Don't rely on any speculative type in the bailout version. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cosmetic change (formatting). Created 8 years, 8 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 class BailoutInfo { 5 class BailoutInfo {
6 int instructionId; 6 int instructionId;
7 int bailoutId; 7 int bailoutId;
8 BailoutInfo(this.instructionId, this.bailoutId); 8 BailoutInfo(this.instructionId, this.bailoutId);
9 } 9 }
10 10
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 HType propagatedType = instruction.propagatedType; 279 HType propagatedType = instruction.propagatedType;
280 return propagatedType.isUseful() 280 return propagatedType.isUseful()
281 && propagatedType != instruction.computeTypeFromInputTypes(); 281 && propagatedType != instruction.computeTypeFromInputTypes();
282 } 282 }
283 283
284 void insertCapturedEnvironments() { 284 void insertCapturedEnvironments() {
285 work.guards = <HTypeGuard>[]; 285 work.guards = <HTypeGuard>[];
286 int state = 1; 286 int state = 1;
287 capturedEnvironments.forEach((HInstruction instruction, Environment env) { 287 capturedEnvironments.forEach((HInstruction instruction, Environment env) {
288 List<HInstruction> inputs = env.buildAndSetLast(instruction); 288 List<HInstruction> inputs = env.buildAndSetLast(instruction);
289 HTypeGuard guard = new HTypeGuard(state++, inputs); 289 HTypeGuard guard =
290 new HTypeGuard(instruction.propagatedType, state++, inputs);
290 work.guards.add(guard); 291 work.guards.add(guard);
291 instruction.block.rewrite(instruction, guard); 292 instruction.block.rewrite(instruction, guard);
292 HInstruction insertionPoint = (instruction is HPhi) 293 HInstruction insertionPoint = (instruction is HPhi)
293 ? instruction.block.first 294 ? instruction.block.first
294 : instruction.next; 295 : instruction.next;
295 insertionPoint.block.addBefore(insertionPoint, guard); 296 insertionPoint.block.addBefore(insertionPoint, guard);
296 }); 297 });
297 } 298 }
298 } 299 }
299 300
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 compiler.internalError('Control flow instructions already dealt with.', 362 compiler.internalError('Control flow instructions already dealt with.',
362 instruction: instruction); 363 instruction: instruction);
363 } 364 }
364 365
365 visitTypeGuard(HTypeGuard guard) { 366 visitTypeGuard(HTypeGuard guard) {
366 blocks.forEach((HBasicBlock block) { 367 blocks.forEach((HBasicBlock block) {
367 block.guards.add(guard); 368 block.guards.add(guard);
368 }); 369 });
369 } 370 }
370 } 371 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/nodes.dart » ('j') | lib/compiler/implementation/ssa/nodes.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698