| 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 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); |
| 11 R visitBitXor(HBitXor node); | 11 R visitBitXor(HBitXor node); |
| 12 R visitBoolify(HBoolify node); | 12 R visitBoolify(HBoolify node); |
| 13 R visitBoundsCheck(HBoundsCheck node); | 13 R visitBoundsCheck(HBoundsCheck node); |
| 14 R visitBreak(HBreak node); | 14 R visitBreak(HBreak node); |
| 15 R visitConstant(HConstant node); | 15 R visitConstant(HConstant node); |
| (...skipping 2618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2634 class HBlockFlow { | 2634 class HBlockFlow { |
| 2635 final HBlockInformation body; | 2635 final HBlockInformation body; |
| 2636 final HBasicBlock continuation; | 2636 final HBasicBlock continuation; |
| 2637 HBlockFlow(this.body, this.continuation); | 2637 HBlockFlow(this.body, this.continuation); |
| 2638 } | 2638 } |
| 2639 | 2639 |
| 2640 | 2640 |
| 2641 /** | 2641 /** |
| 2642 * Information about a syntactic-like structure. | 2642 * Information about a syntactic-like structure. |
| 2643 */ | 2643 */ |
| 2644 interface HBlockInformation { | 2644 abstract class HBlockInformation { |
| 2645 HBasicBlock get start; | 2645 HBasicBlock get start; |
| 2646 HBasicBlock get end; | 2646 HBasicBlock get end; |
| 2647 bool accept(HBlockInformationVisitor visitor); | 2647 bool accept(HBlockInformationVisitor visitor); |
| 2648 } | 2648 } |
| 2649 | 2649 |
| 2650 | 2650 |
| 2651 /** | 2651 /** |
| 2652 * Information about a statement-like structure. | 2652 * Information about a statement-like structure. |
| 2653 */ | 2653 */ |
| 2654 interface HStatementInformation extends HBlockInformation { | 2654 abstract class HStatementInformation extends HBlockInformation { |
| 2655 bool accept(HStatementInformationVisitor visitor); | 2655 bool accept(HStatementInformationVisitor visitor); |
| 2656 } | 2656 } |
| 2657 | 2657 |
| 2658 | 2658 |
| 2659 /** | 2659 /** |
| 2660 * Information about an expression-like structure. | 2660 * Information about an expression-like structure. |
| 2661 */ | 2661 */ |
| 2662 interface HExpressionInformation extends HBlockInformation { | 2662 abstract class HExpressionInformation extends HBlockInformation { |
| 2663 bool accept(HExpressionInformationVisitor visitor); | 2663 bool accept(HExpressionInformationVisitor visitor); |
| 2664 HInstruction get conditionExpression; | 2664 HInstruction get conditionExpression; |
| 2665 } | 2665 } |
| 2666 | 2666 |
| 2667 | 2667 |
| 2668 interface HStatementInformationVisitor { | 2668 abstract class HStatementInformationVisitor { |
| 2669 bool visitLabeledBlockInfo(HLabeledBlockInformation info); | 2669 bool visitLabeledBlockInfo(HLabeledBlockInformation info); |
| 2670 bool visitLoopInfo(HLoopBlockInformation info); | 2670 bool visitLoopInfo(HLoopBlockInformation info); |
| 2671 bool visitIfInfo(HIfBlockInformation info); | 2671 bool visitIfInfo(HIfBlockInformation info); |
| 2672 bool visitTryInfo(HTryBlockInformation info); | 2672 bool visitTryInfo(HTryBlockInformation info); |
| 2673 bool visitSwitchInfo(HSwitchBlockInformation info); | 2673 bool visitSwitchInfo(HSwitchBlockInformation info); |
| 2674 bool visitSequenceInfo(HStatementSequenceInformation info); | 2674 bool visitSequenceInfo(HStatementSequenceInformation info); |
| 2675 // Pseudo-structure embedding a dominator-based traversal into | 2675 // Pseudo-structure embedding a dominator-based traversal into |
| 2676 // the block-structure traversal. This will eventually go away. | 2676 // the block-structure traversal. This will eventually go away. |
| 2677 bool visitSubGraphInfo(HSubGraphBlockInformation info); | 2677 bool visitSubGraphInfo(HSubGraphBlockInformation info); |
| 2678 } | 2678 } |
| 2679 | 2679 |
| 2680 | 2680 |
| 2681 interface HExpressionInformationVisitor { | 2681 abstract class HExpressionInformationVisitor { |
| 2682 bool visitAndOrInfo(HAndOrBlockInformation info); | 2682 bool visitAndOrInfo(HAndOrBlockInformation info); |
| 2683 bool visitSubExpressionInfo(HSubExpressionBlockInformation info); | 2683 bool visitSubExpressionInfo(HSubExpressionBlockInformation info); |
| 2684 } | 2684 } |
| 2685 | 2685 |
| 2686 | 2686 |
| 2687 interface HBlockInformationVisitor extends HStatementInformationVisitor, | 2687 abstract class HBlockInformationVisitor |
| 2688 HExpressionInformationVisitor { | 2688 implements HStatementInformationVisitor, HExpressionInformationVisitor { |
| 2689 } | 2689 } |
| 2690 | 2690 |
| 2691 | 2691 |
| 2692 /** | 2692 /** |
| 2693 * Generic class wrapping a [SubGraph] as a block-information until | 2693 * Generic class wrapping a [SubGraph] as a block-information until |
| 2694 * all structures are handled properly. | 2694 * all structures are handled properly. |
| 2695 */ | 2695 */ |
| 2696 class HSubGraphBlockInformation implements HStatementInformation { | 2696 class HSubGraphBlockInformation implements HStatementInformation { |
| 2697 final SubGraph subGraph; | 2697 final SubGraph subGraph; |
| 2698 HSubGraphBlockInformation(this.subGraph); | 2698 HSubGraphBlockInformation(this.subGraph); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2897 HBasicBlock get start => expression.start; | 2897 HBasicBlock get start => expression.start; |
| 2898 HBasicBlock get end { | 2898 HBasicBlock get end { |
| 2899 // We don't create a switch block if there are no cases. | 2899 // We don't create a switch block if there are no cases. |
| 2900 assert(!statements.isEmpty()); | 2900 assert(!statements.isEmpty()); |
| 2901 return statements.last().end; | 2901 return statements.last().end; |
| 2902 } | 2902 } |
| 2903 | 2903 |
| 2904 bool accept(HStatementInformationVisitor visitor) => | 2904 bool accept(HStatementInformationVisitor visitor) => |
| 2905 visitor.visitSwitchInfo(this); | 2905 visitor.visitSwitchInfo(this); |
| 2906 } | 2906 } |
| OLD | NEW |