| 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 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 static const int FULL_CHECK = 1; | 1237 static const int FULL_CHECK = 1; |
| 1238 static const int ALWAYS_ABOVE_ZERO = 2; | 1238 static const int ALWAYS_ABOVE_ZERO = 2; |
| 1239 static const int ALWAYS_BELOW_LENGTH = 3; | 1239 static const int ALWAYS_BELOW_LENGTH = 3; |
| 1240 static const int ALWAYS_TRUE = 4; | 1240 static const int ALWAYS_TRUE = 4; |
| 1241 /** | 1241 /** |
| 1242 * Details which tests have been done statically during compilation. | 1242 * Details which tests have been done statically during compilation. |
| 1243 * Default is that all checks must be performed dynamically. | 1243 * Default is that all checks must be performed dynamically. |
| 1244 */ | 1244 */ |
| 1245 int staticChecks = FULL_CHECK; | 1245 int staticChecks = FULL_CHECK; |
| 1246 | 1246 |
| 1247 HBoundsCheck(length, index) : super(<HInstruction>[length, index]) { | 1247 HBoundsCheck(length, index, array) |
| 1248 : super(<HInstruction>[length, index, array]) { |
| 1248 instructionType = HType.INTEGER; | 1249 instructionType = HType.INTEGER; |
| 1249 } | 1250 } |
| 1250 | 1251 |
| 1251 HInstruction get length => inputs[1]; | 1252 HInstruction get length => inputs[1]; |
| 1252 HInstruction get index => inputs[0]; | 1253 HInstruction get index => inputs[0]; |
| 1254 HInstruction get array => inputs[2]; |
| 1253 bool isControlFlow() => true; | 1255 bool isControlFlow() => true; |
| 1254 | 1256 |
| 1255 accept(HVisitor visitor) => visitor.visitBoundsCheck(this); | 1257 accept(HVisitor visitor) => visitor.visitBoundsCheck(this); |
| 1256 int typeCode() => HInstruction.BOUNDS_CHECK_TYPECODE; | 1258 int typeCode() => HInstruction.BOUNDS_CHECK_TYPECODE; |
| 1257 bool typeEquals(other) => other is HBoundsCheck; | 1259 bool typeEquals(other) => other is HBoundsCheck; |
| 1258 bool dataEquals(HInstruction other) => true; | 1260 bool dataEquals(HInstruction other) => true; |
| 1259 } | 1261 } |
| 1260 | 1262 |
| 1261 abstract class HConditionalBranch extends HControlFlow { | 1263 abstract class HConditionalBranch extends HControlFlow { |
| 1262 HConditionalBranch(inputs) : super(inputs); | 1264 HConditionalBranch(inputs) : super(inputs); |
| (...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2728 HBasicBlock get start => expression.start; | 2730 HBasicBlock get start => expression.start; |
| 2729 HBasicBlock get end { | 2731 HBasicBlock get end { |
| 2730 // We don't create a switch block if there are no cases. | 2732 // We don't create a switch block if there are no cases. |
| 2731 assert(!statements.isEmpty); | 2733 assert(!statements.isEmpty); |
| 2732 return statements.last.end; | 2734 return statements.last.end; |
| 2733 } | 2735 } |
| 2734 | 2736 |
| 2735 bool accept(HStatementInformationVisitor visitor) => | 2737 bool accept(HStatementInformationVisitor visitor) => |
| 2736 visitor.visitSwitchInfo(this); | 2738 visitor.visitSwitchInfo(this); |
| 2737 } | 2739 } |
| OLD | NEW |