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

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

Issue 13872007: Refactor removeRange. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebuild dom. Created 7 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 part of ssa; 5 part of ssa;
6 6
7 abstract class HVisitor<R> { 7 abstract class HVisitor<R> {
8 R visitAdd(HAdd node); 8 R visitAdd(HAdd node);
9 R visitBailoutTarget(HBailoutTarget node); 9 R visitBailoutTarget(HBailoutTarget node);
10 R visitBitAnd(HBitAnd node); 10 R visitBitAnd(HBitAnd node);
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 } 664 }
665 665
666 void removeDominatedBlock(HBasicBlock block) { 666 void removeDominatedBlock(HBasicBlock block) {
667 assert(isClosed()); 667 assert(isClosed());
668 assert(id != null && block.id != null); 668 assert(id != null && block.id != null);
669 int index = dominatedBlocks.indexOf(block); 669 int index = dominatedBlocks.indexOf(block);
670 assert(index >= 0); 670 assert(index >= 0);
671 if (index == dominatedBlocks.length - 1) { 671 if (index == dominatedBlocks.length - 1) {
672 dominatedBlocks.removeLast(); 672 dominatedBlocks.removeLast();
673 } else { 673 } else {
674 dominatedBlocks.removeRange(index, 1); 674 dominatedBlocks.removeRange(index, index + 1);
675 } 675 }
676 assert(identical(block.dominator, this)); 676 assert(identical(block.dominator, this));
677 block.dominator = null; 677 block.dominator = null;
678 } 678 }
679 679
680 void assignCommonDominator(HBasicBlock predecessor) { 680 void assignCommonDominator(HBasicBlock predecessor) {
681 assert(isClosed()); 681 assert(isClosed());
682 if (dominator == null) { 682 if (dominator == null) {
683 // If this basic block doesn't have a dominator yet we use the 683 // If this basic block doesn't have a dominator yet we use the
684 // given predecessor as the dominator. 684 // given predecessor as the dominator.
(...skipping 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after
2638 HBasicBlock get start => expression.start; 2638 HBasicBlock get start => expression.start;
2639 HBasicBlock get end { 2639 HBasicBlock get end {
2640 // We don't create a switch block if there are no cases. 2640 // We don't create a switch block if there are no cases.
2641 assert(!statements.isEmpty); 2641 assert(!statements.isEmpty);
2642 return statements.last.end; 2642 return statements.last.end;
2643 } 2643 }
2644 2644
2645 bool accept(HStatementInformationVisitor visitor) => 2645 bool accept(HStatementInformationVisitor visitor) =>
2646 visitor.visitSwitchInfo(this); 2646 visitor.visitSwitchInfo(this);
2647 } 2647 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698