| OLD | NEW |
| 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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 } | 666 } |
| 667 | 667 |
| 668 void removeDominatedBlock(HBasicBlock block) { | 668 void removeDominatedBlock(HBasicBlock block) { |
| 669 assert(isClosed()); | 669 assert(isClosed()); |
| 670 assert(id != null && block.id != null); | 670 assert(id != null && block.id != null); |
| 671 int index = dominatedBlocks.indexOf(block); | 671 int index = dominatedBlocks.indexOf(block); |
| 672 assert(index >= 0); | 672 assert(index >= 0); |
| 673 if (index == dominatedBlocks.length - 1) { | 673 if (index == dominatedBlocks.length - 1) { |
| 674 dominatedBlocks.removeLast(); | 674 dominatedBlocks.removeLast(); |
| 675 } else { | 675 } else { |
| 676 dominatedBlocks.removeRange(index, 1); | 676 dominatedBlocks.removeRange(index, index + 1); |
| 677 } | 677 } |
| 678 assert(identical(block.dominator, this)); | 678 assert(identical(block.dominator, this)); |
| 679 block.dominator = null; | 679 block.dominator = null; |
| 680 } | 680 } |
| 681 | 681 |
| 682 void assignCommonDominator(HBasicBlock predecessor) { | 682 void assignCommonDominator(HBasicBlock predecessor) { |
| 683 assert(isClosed()); | 683 assert(isClosed()); |
| 684 if (dominator == null) { | 684 if (dominator == null) { |
| 685 // If this basic block doesn't have a dominator yet we use the | 685 // If this basic block doesn't have a dominator yet we use the |
| 686 // given predecessor as the dominator. | 686 // given predecessor as the dominator. |
| (...skipping 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2647 HBasicBlock get start => expression.start; | 2647 HBasicBlock get start => expression.start; |
| 2648 HBasicBlock get end { | 2648 HBasicBlock get end { |
| 2649 // We don't create a switch block if there are no cases. | 2649 // We don't create a switch block if there are no cases. |
| 2650 assert(!statements.isEmpty); | 2650 assert(!statements.isEmpty); |
| 2651 return statements.last.end; | 2651 return statements.last.end; |
| 2652 } | 2652 } |
| 2653 | 2653 |
| 2654 bool accept(HStatementInformationVisitor visitor) => | 2654 bool accept(HStatementInformationVisitor visitor) => |
| 2655 visitor.visitSwitchInfo(this); | 2655 visitor.visitSwitchInfo(this); |
| 2656 } | 2656 } |
| OLD | NEW |