| 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 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 | 1210 |
| 1211 void disable() { | 1211 void disable() { |
| 1212 isEnabled = false; | 1212 isEnabled = false; |
| 1213 instructionType = guarded.instructionType; | 1213 instructionType = guarded.instructionType; |
| 1214 } | 1214 } |
| 1215 | 1215 |
| 1216 bool isControlFlow() => true; | 1216 bool isControlFlow() => true; |
| 1217 bool isJsStatement() => isEnabled; | 1217 bool isJsStatement() => isEnabled; |
| 1218 bool canThrow() => isEnabled; | 1218 bool canThrow() => isEnabled; |
| 1219 | 1219 |
| 1220 // A [HTypeGuard] cannot be moved anywhere in the graph, otherwise |
| 1221 // instructions that have side effects could end up before the guard |
| 1222 // in the otpimized version, and after the guard in a bailout |
| 1223 // version. |
| 1224 bool isPure() => false; |
| 1225 |
| 1220 accept(HVisitor visitor) => visitor.visitTypeGuard(this); | 1226 accept(HVisitor visitor) => visitor.visitTypeGuard(this); |
| 1221 int typeCode() => HInstruction.TYPE_GUARD_TYPECODE; | 1227 int typeCode() => HInstruction.TYPE_GUARD_TYPECODE; |
| 1222 bool typeEquals(other) => other is HTypeGuard; | 1228 bool typeEquals(other) => other is HTypeGuard; |
| 1223 bool dataEquals(HTypeGuard other) => guardedType == other.guardedType; | 1229 bool dataEquals(HTypeGuard other) => guardedType == other.guardedType; |
| 1224 } | 1230 } |
| 1225 | 1231 |
| 1226 class HBoundsCheck extends HCheck { | 1232 class HBoundsCheck extends HCheck { |
| 1227 static const int ALWAYS_FALSE = 0; | 1233 static const int ALWAYS_FALSE = 0; |
| 1228 static const int FULL_CHECK = 1; | 1234 static const int FULL_CHECK = 1; |
| 1229 static const int ALWAYS_ABOVE_ZERO = 2; | 1235 static const int ALWAYS_ABOVE_ZERO = 2; |
| (...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2556 HBasicBlock get start => expression.start; | 2562 HBasicBlock get start => expression.start; |
| 2557 HBasicBlock get end { | 2563 HBasicBlock get end { |
| 2558 // We don't create a switch block if there are no cases. | 2564 // We don't create a switch block if there are no cases. |
| 2559 assert(!statements.isEmpty); | 2565 assert(!statements.isEmpty); |
| 2560 return statements.last.end; | 2566 return statements.last.end; |
| 2561 } | 2567 } |
| 2562 | 2568 |
| 2563 bool accept(HStatementInformationVisitor visitor) => | 2569 bool accept(HStatementInformationVisitor visitor) => |
| 2564 visitor.visitSwitchInfo(this); | 2570 visitor.visitSwitchInfo(this); |
| 2565 } | 2571 } |
| OLD | NEW |