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 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 /** | 1111 /** |
1112 * The code for computing a bailout environment, and the code | 1112 * The code for computing a bailout environment, and the code |
1113 * generation must agree on what does not need to be captured, | 1113 * generation must agree on what does not need to be captured, |
1114 * so should always be generated at use site. | 1114 * so should always be generated at use site. |
1115 */ | 1115 */ |
1116 bool isCodeMotionInvariant() => false; | 1116 bool isCodeMotionInvariant() => false; |
1117 | 1117 |
1118 bool isJsStatement(HTypeMap types) => false; | 1118 bool isJsStatement(HTypeMap types) => false; |
1119 | 1119 |
1120 bool dominates(HInstruction other) { | 1120 bool dominates(HInstruction other) { |
| 1121 // An instruction does not dominates itself. |
| 1122 if (this == other) return false; |
1121 if (block != other.block) return block.dominates(other.block); | 1123 if (block != other.block) return block.dominates(other.block); |
1122 | 1124 |
1123 HInstruction current = this; | 1125 HInstruction current = this.next; |
1124 while (current != null) { | 1126 while (current != null) { |
1125 if (identical(current, other)) return true; | 1127 if (current == other) return true; |
1126 current = current.next; | 1128 current = current.next; |
1127 } | 1129 } |
1128 return false; | 1130 return false; |
1129 } | 1131 } |
1130 | 1132 |
1131 | 1133 |
1132 HInstruction convertType(Compiler compiler, DartType type, int kind) { | 1134 HInstruction convertType(Compiler compiler, DartType type, int kind) { |
1133 if (type == null) return this; | 1135 if (type == null) return this; |
1134 if (identical(type.element, compiler.dynamicClass)) return this; | 1136 if (identical(type.element, compiler.dynamicClass)) return this; |
1135 if (identical(type.element, compiler.objectClass)) return this; | 1137 if (identical(type.element, compiler.objectClass)) return this; |
(...skipping 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3014 HBasicBlock get start => expression.start; | 3016 HBasicBlock get start => expression.start; |
3015 HBasicBlock get end { | 3017 HBasicBlock get end { |
3016 // We don't create a switch block if there are no cases. | 3018 // We don't create a switch block if there are no cases. |
3017 assert(!statements.isEmpty); | 3019 assert(!statements.isEmpty); |
3018 return statements.last.end; | 3020 return statements.last.end; |
3019 } | 3021 } |
3020 | 3022 |
3021 bool accept(HStatementInformationVisitor visitor) => | 3023 bool accept(HStatementInformationVisitor visitor) => |
3022 visitor.visitSwitchInfo(this); | 3024 visitor.visitSwitchInfo(this); |
3023 } | 3025 } |
OLD | NEW |