| 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 interface HVisitor<R> { | 5 interface HVisitor<R> { |
| 6 R visitAdd(HAdd node); | 6 R visitAdd(HAdd node); |
| 7 R visitBitAnd(HBitAnd node); | 7 R visitBitAnd(HBitAnd node); |
| 8 R visitBitNot(HBitNot node); | 8 R visitBitNot(HBitNot node); |
| 9 R visitBitOr(HBitOr node); | 9 R visitBitOr(HBitOr node); |
| 10 R visitBitXor(HBitXor node); | 10 R visitBitXor(HBitXor node); |
| (...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 HParameterValue exception; | 1741 HParameterValue exception; |
| 1742 HBasicBlock catchBlock; | 1742 HBasicBlock catchBlock; |
| 1743 HBasicBlock finallyBlock; | 1743 HBasicBlock finallyBlock; |
| 1744 HTry() : super(const <HInstruction>[]); | 1744 HTry() : super(const <HInstruction>[]); |
| 1745 toString() => 'try'; | 1745 toString() => 'try'; |
| 1746 accept(HVisitor visitor) => visitor.visitTry(this); | 1746 accept(HVisitor visitor) => visitor.visitTry(this); |
| 1747 HBasicBlock get joinBlock() => this.block.successors.last(); | 1747 HBasicBlock get joinBlock() => this.block.successors.last(); |
| 1748 } | 1748 } |
| 1749 | 1749 |
| 1750 class HIf extends HConditionalBranch { | 1750 class HIf extends HConditionalBranch { |
| 1751 bool hasElse; | |
| 1752 HBlockFlow blockInformation = null; | 1751 HBlockFlow blockInformation = null; |
| 1753 HIf(HInstruction condition, this.hasElse) : super(<HInstruction>[condition]); | 1752 HIf(HInstruction condition) : super(<HInstruction>[condition]); |
| 1754 toString() => 'if'; | 1753 toString() => 'if'; |
| 1755 accept(HVisitor visitor) => visitor.visitIf(this); | 1754 accept(HVisitor visitor) => visitor.visitIf(this); |
| 1756 | 1755 |
| 1757 HBasicBlock get thenBlock() { | 1756 HBasicBlock get thenBlock() { |
| 1758 assert(block.dominatedBlocks[0] === block.successors[0]); | 1757 assert(block.dominatedBlocks[0] === block.successors[0]); |
| 1759 return block.successors[0]; | 1758 return block.successors[0]; |
| 1760 } | 1759 } |
| 1761 | 1760 |
| 1762 HBasicBlock get elseBlock() { | 1761 HBasicBlock get elseBlock() { |
| 1763 if (hasElse) { | 1762 assert(block.dominatedBlocks[1] === block.successors[1]); |
| 1764 assert(block.dominatedBlocks[1] === block.successors[1]); | 1763 return block.successors[1]; |
| 1765 return block.successors[1]; | |
| 1766 } else { | |
| 1767 return null; | |
| 1768 } | |
| 1769 } | 1764 } |
| 1770 | 1765 |
| 1771 HBasicBlock get joinBlock() => blockInformation.continuation; | 1766 HBasicBlock get joinBlock() => blockInformation.continuation; |
| 1772 } | 1767 } |
| 1773 | 1768 |
| 1774 class HLoopBranch extends HConditionalBranch { | 1769 class HLoopBranch extends HConditionalBranch { |
| 1775 static final int CONDITION_FIRST_LOOP = 0; | 1770 static final int CONDITION_FIRST_LOOP = 0; |
| 1776 static final int DO_WHILE_LOOP = 1; | 1771 static final int DO_WHILE_LOOP = 1; |
| 1777 | 1772 |
| 1778 final int kind; | 1773 final int kind; |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2629 HBasicBlock get start() => expression.start; | 2624 HBasicBlock get start() => expression.start; |
| 2630 HBasicBlock get end() { | 2625 HBasicBlock get end() { |
| 2631 // We don't create a switch block if there are no cases. | 2626 // We don't create a switch block if there are no cases. |
| 2632 assert(!statements.isEmpty()); | 2627 assert(!statements.isEmpty()); |
| 2633 return statements.last().end; | 2628 return statements.last().end; |
| 2634 } | 2629 } |
| 2635 | 2630 |
| 2636 bool accept(HStatementInformationVisitor visitor) => | 2631 bool accept(HStatementInformationVisitor visitor) => |
| 2637 visitor.visitSwitchInfo(this); | 2632 visitor.visitSwitchInfo(this); |
| 2638 } | 2633 } |
| OLD | NEW |