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

Side by Side Diff: frog/leg/ssa/nodes.dart

Issue 9668029: Fix a long-standing bug in the computation of the live environments for bailouts. When visiting a l… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 interface HVisitor<R> { 5 interface HVisitor<R> {
6 R visitAdd(HAdd node); 6 R visitAdd(HAdd node);
7 R visitBailoutTarget(HBailoutTarget node); 7 R visitBailoutTarget(HBailoutTarget node);
8 R visitBitAnd(HBitAnd node); 8 R visitBitAnd(HBitAnd node);
9 R visitBitNot(HBitNot node); 9 R visitBitNot(HBitNot node);
10 R visitBitOr(HBitOr node); 10 R visitBitOr(HBitOr node);
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 bool contains(HInstruction instruction) { 391 bool contains(HInstruction instruction) {
392 HInstruction cursor = first; 392 HInstruction cursor = first;
393 while (cursor != null) { 393 while (cursor != null) {
394 if (cursor === instruction) return true; 394 if (cursor === instruction) return true;
395 cursor = cursor.next; 395 cursor = cursor.next;
396 } 396 }
397 return false; 397 return false;
398 } 398 }
399 } 399 }
400 400
401 class HBasicBlock extends HInstructionList { 401 class HBasicBlock extends HInstructionList implements Hashable {
402 // The [id] must be such that any successor's id is greater than 402 // The [id] must be such that any successor's id is greater than
403 // this [id]. The exception are back-edges. 403 // this [id]. The exception are back-edges.
404 int id; 404 int id;
405 405
406 static final int STATUS_NEW = 0; 406 static final int STATUS_NEW = 0;
407 static final int STATUS_OPEN = 1; 407 static final int STATUS_OPEN = 1;
408 static final int STATUS_CLOSED = 2; 408 static final int STATUS_CLOSED = 2;
409 int status = STATUS_NEW; 409 int status = STATUS_NEW;
410 410
411 HInstructionList phis; 411 HInstructionList phis;
(...skipping 13 matching lines...) Expand all
425 List<SourceString> labels; 425 List<SourceString> labels;
426 426
427 HBasicBlock() : this.withId(null); 427 HBasicBlock() : this.withId(null);
428 HBasicBlock.withId(this.id) 428 HBasicBlock.withId(this.id)
429 : phis = new HInstructionList(), 429 : phis = new HInstructionList(),
430 predecessors = <HBasicBlock>[], 430 predecessors = <HBasicBlock>[],
431 successors = const <HBasicBlock>[], 431 successors = const <HBasicBlock>[],
432 dominatedBlocks = <HBasicBlock>[], 432 dominatedBlocks = <HBasicBlock>[],
433 bailouts = <HBailoutTarget>[]; 433 bailouts = <HBailoutTarget>[];
434 434
435 int hashCode() => id;
436
435 bool isNew() => status == STATUS_NEW; 437 bool isNew() => status == STATUS_NEW;
436 bool isOpen() => status == STATUS_OPEN; 438 bool isOpen() => status == STATUS_OPEN;
437 bool isClosed() => status == STATUS_CLOSED; 439 bool isClosed() => status == STATUS_CLOSED;
438 440
439 bool isLoopHeader() => loopInformation !== null; 441 bool isLoopHeader() => loopInformation !== null;
440 bool hasLabeledBlockInformation() => labeledBlockInformation !== null; 442 bool hasLabeledBlockInformation() => labeledBlockInformation !== null;
441 443
442 bool hasBailouts() => !bailouts.isEmpty(); 444 bool hasBailouts() => !bailouts.isEmpty();
443 445
444 void open() { 446 void open() {
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 class HIfBlockInformation { 2119 class HIfBlockInformation {
2118 final HIf branch; 2120 final HIf branch;
2119 final SubGraph thenGraph; 2121 final SubGraph thenGraph;
2120 final SubGraph elseGraph; 2122 final SubGraph elseGraph;
2121 final HBasicBlock joinBlock; 2123 final HBasicBlock joinBlock;
2122 HIfBlockInformation(this.branch, 2124 HIfBlockInformation(this.branch,
2123 this.thenGraph, 2125 this.thenGraph,
2124 this.elseGraph, 2126 this.elseGraph,
2125 this.joinBlock); 2127 this.joinBlock);
2126 } 2128 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698