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 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 2595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2606 final HBlockInformation body; | 2606 final HBlockInformation body; |
2607 final HBasicBlock continuation; | 2607 final HBasicBlock continuation; |
2608 HBlockFlow(this.body, this.continuation); | 2608 HBlockFlow(this.body, this.continuation); |
2609 } | 2609 } |
2610 | 2610 |
2611 | 2611 |
2612 /** | 2612 /** |
2613 * Information about a syntactic-like structure. | 2613 * Information about a syntactic-like structure. |
2614 */ | 2614 */ |
2615 interface HBlockInformation { | 2615 interface HBlockInformation { |
2616 HBasicBlock get start(); | 2616 HBasicBlock get start; |
2617 HBasicBlock get end(); | 2617 HBasicBlock get end; |
2618 bool accept(HBlockInformationVisitor visitor); | 2618 bool accept(HBlockInformationVisitor visitor); |
2619 } | 2619 } |
2620 | 2620 |
2621 | 2621 |
2622 /** | 2622 /** |
2623 * Information about a statement-like structure. | 2623 * Information about a statement-like structure. |
2624 */ | 2624 */ |
2625 interface HStatementInformation extends HBlockInformation { | 2625 interface HStatementInformation extends HBlockInformation { |
2626 bool accept(HStatementInformationVisitor visitor); | 2626 bool accept(HStatementInformationVisitor visitor); |
2627 } | 2627 } |
2628 | 2628 |
2629 | 2629 |
2630 /** | 2630 /** |
2631 * Information about an expression-like structure. | 2631 * Information about an expression-like structure. |
2632 */ | 2632 */ |
2633 interface HExpressionInformation extends HBlockInformation { | 2633 interface HExpressionInformation extends HBlockInformation { |
2634 bool accept(HExpressionInformationVisitor visitor); | 2634 bool accept(HExpressionInformationVisitor visitor); |
2635 HInstruction get conditionExpression(); | 2635 HInstruction get conditionExpression; |
2636 } | 2636 } |
2637 | 2637 |
2638 | 2638 |
2639 interface HStatementInformationVisitor { | 2639 interface HStatementInformationVisitor { |
2640 bool visitLabeledBlockInfo(HLabeledBlockInformation info); | 2640 bool visitLabeledBlockInfo(HLabeledBlockInformation info); |
2641 bool visitLoopInfo(HLoopBlockInformation info); | 2641 bool visitLoopInfo(HLoopBlockInformation info); |
2642 bool visitIfInfo(HIfBlockInformation info); | 2642 bool visitIfInfo(HIfBlockInformation info); |
2643 bool visitTryInfo(HTryBlockInformation info); | 2643 bool visitTryInfo(HTryBlockInformation info); |
2644 bool visitSwitchInfo(HSwitchBlockInformation info); | 2644 bool visitSwitchInfo(HSwitchBlockInformation info); |
2645 bool visitSequenceInfo(HStatementSequenceInformation info); | 2645 bool visitSequenceInfo(HStatementSequenceInformation info); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2866 HBasicBlock get start => expression.start; | 2866 HBasicBlock get start => expression.start; |
2867 HBasicBlock get end { | 2867 HBasicBlock get end { |
2868 // We don't create a switch block if there are no cases. | 2868 // We don't create a switch block if there are no cases. |
2869 assert(!statements.isEmpty()); | 2869 assert(!statements.isEmpty()); |
2870 return statements.last().end; | 2870 return statements.last().end; |
2871 } | 2871 } |
2872 | 2872 |
2873 bool accept(HStatementInformationVisitor visitor) => | 2873 bool accept(HStatementInformationVisitor visitor) => |
2874 visitor.visitSwitchInfo(this); | 2874 visitor.visitSwitchInfo(this); |
2875 } | 2875 } |
OLD | NEW |