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

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

Issue 10987073: Fix issue 5517 by setting the successors the right way in a try/catch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 abstract class HVisitor<R> { 5 abstract class 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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 574
575 void remove(HInstruction instruction) { 575 void remove(HInstruction instruction) {
576 assert(isOpen() || isClosed()); 576 assert(isOpen() || isClosed());
577 assert(instruction is !HPhi); 577 assert(instruction is !HPhi);
578 super.remove(instruction); 578 super.remove(instruction);
579 assert(instruction.block == this); 579 assert(instruction.block == this);
580 instruction.notifyRemovedFromBlock(); 580 instruction.notifyRemovedFromBlock();
581 } 581 }
582 582
583 void addSuccessor(HBasicBlock block) { 583 void addSuccessor(HBasicBlock block) {
584 // Forward branches are only allowed to new blocks.
585 assert(isClosed() && (block.isNew() || block.id < id));
586 if (successors.isEmpty()) { 584 if (successors.isEmpty()) {
587 successors = [block]; 585 successors = [block];
588 } else { 586 } else {
589 successors.add(block); 587 successors.add(block);
590 } 588 }
591 block.predecessors.add(this); 589 block.predecessors.add(this);
592 } 590 }
593 591
594 void postProcessLoopHeader() { 592 void postProcessLoopHeader() {
595 assert(isLoopHeader()); 593 assert(isLoopHeader());
(...skipping 2323 matching lines...) Expand 10 before | Expand all | Expand 10 after
2919 HBasicBlock get start => expression.start; 2917 HBasicBlock get start => expression.start;
2920 HBasicBlock get end { 2918 HBasicBlock get end {
2921 // We don't create a switch block if there are no cases. 2919 // We don't create a switch block if there are no cases.
2922 assert(!statements.isEmpty()); 2920 assert(!statements.isEmpty());
2923 return statements.last().end; 2921 return statements.last().end;
2924 } 2922 }
2925 2923
2926 bool accept(HStatementInformationVisitor visitor) => 2924 bool accept(HStatementInformationVisitor visitor) =>
2927 visitor.visitSwitchInfo(this); 2925 visitor.visitSwitchInfo(this);
2928 } 2926 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/ssa/validate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698