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 2909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2920 } | 2920 } |
2921 return condition.start; | 2921 return condition.start; |
2922 } | 2922 } |
2923 | 2923 |
2924 HBasicBlock get loopHeader { | 2924 HBasicBlock get loopHeader { |
2925 return kind == DO_WHILE_LOOP ? body.start : condition.start; | 2925 return kind == DO_WHILE_LOOP ? body.start : condition.start; |
2926 } | 2926 } |
2927 | 2927 |
2928 HBasicBlock get end { | 2928 HBasicBlock get end { |
2929 if (updates != null) return updates.end; | 2929 if (updates != null) return updates.end; |
2930 if (kind == DO_WHILE_LOOP) { | 2930 if (kind == DO_WHILE_LOOP && condition != null) { |
2931 return condition.end; | 2931 return condition.end; |
2932 } | 2932 } |
2933 return body.end; | 2933 return body.end; |
2934 } | 2934 } |
2935 | 2935 |
2936 static int loopType(Node node) { | 2936 static int loopType(Node node) { |
2937 return node.accept(const LoopTypeVisitor()); | 2937 return node.accept(const LoopTypeVisitor()); |
2938 } | 2938 } |
2939 | 2939 |
2940 bool accept(HStatementInformationVisitor visitor) => | 2940 bool accept(HStatementInformationVisitor visitor) => |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3015 HBasicBlock get start => expression.start; | 3015 HBasicBlock get start => expression.start; |
3016 HBasicBlock get end { | 3016 HBasicBlock get end { |
3017 // We don't create a switch block if there are no cases. | 3017 // We don't create a switch block if there are no cases. |
3018 assert(!statements.isEmpty); | 3018 assert(!statements.isEmpty); |
3019 return statements.last.end; | 3019 return statements.last.end; |
3020 } | 3020 } |
3021 | 3021 |
3022 bool accept(HStatementInformationVisitor visitor) => | 3022 bool accept(HStatementInformationVisitor visitor) => |
3023 visitor.visitSwitchInfo(this); | 3023 visitor.visitSwitchInfo(this); |
3024 } | 3024 } |
OLD | NEW |