| 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 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 * being done reference the [HCheck] instruction instead of the | 1120 * being done reference the [HCheck] instruction instead of the |
| 1121 * instruction itself. | 1121 * instruction itself. |
| 1122 */ | 1122 */ |
| 1123 abstract class HCheck extends HInstruction { | 1123 abstract class HCheck extends HInstruction { |
| 1124 HCheck(inputs) : super(inputs) { | 1124 HCheck(inputs) : super(inputs) { |
| 1125 setUseGvn(); | 1125 setUseGvn(); |
| 1126 } | 1126 } |
| 1127 HInstruction get checkedInput => inputs[0]; | 1127 HInstruction get checkedInput => inputs[0]; |
| 1128 bool isJsStatement() => true; | 1128 bool isJsStatement() => true; |
| 1129 bool canThrow() => true; | 1129 bool canThrow() => true; |
| 1130 |
| 1131 HInstruction unwrap() { |
| 1132 var checked = checkedInput; |
| 1133 while (checked is HCheck) checked = checked.checkedInput; |
| 1134 return checked; |
| 1135 } |
| 1130 } | 1136 } |
| 1131 | 1137 |
| 1132 class HBailoutTarget extends HInstruction { | 1138 class HBailoutTarget extends HInstruction { |
| 1133 final int state; | 1139 final int state; |
| 1134 bool isEnabled = true; | 1140 bool isEnabled = true; |
| 1135 // For each argument we record how many dummy (unused) arguments should | 1141 // For each argument we record how many dummy (unused) arguments should |
| 1136 // precede it, to make sure it lands in the correctly named parameter in the | 1142 // precede it, to make sure it lands in the correctly named parameter in the |
| 1137 // bailout function. | 1143 // bailout function. |
| 1138 List<int> padding; | 1144 List<int> padding; |
| 1139 HBailoutTarget(this.state) : super(<HInstruction>[]) { | 1145 HBailoutTarget(this.state) : super(<HInstruction>[]) { |
| (...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2598 HBasicBlock get start => expression.start; | 2604 HBasicBlock get start => expression.start; |
| 2599 HBasicBlock get end { | 2605 HBasicBlock get end { |
| 2600 // We don't create a switch block if there are no cases. | 2606 // We don't create a switch block if there are no cases. |
| 2601 assert(!statements.isEmpty); | 2607 assert(!statements.isEmpty); |
| 2602 return statements.last.end; | 2608 return statements.last.end; |
| 2603 } | 2609 } |
| 2604 | 2610 |
| 2605 bool accept(HStatementInformationVisitor visitor) => | 2611 bool accept(HStatementInformationVisitor visitor) => |
| 2606 visitor.visitSwitchInfo(this); | 2612 visitor.visitSwitchInfo(this); |
| 2607 } | 2613 } |
| OLD | NEW |