| 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 interface HVisitor<R> { | 5 interface HVisitor<R> { |
| 6 R visitAdd(HAdd node); | 6 R visitAdd(HAdd node); |
| 7 R visitBailoutTarget(HBailoutTarget node); | 7 R visitBailoutTarget(HBailoutTarget node); |
| 8 R visitBitAnd(HBitAnd node); | 8 R visitBitAnd(HBitAnd node); |
| 9 R visitBitNot(HBitNot node); | 9 R visitBitNot(HBitNot node); |
| 10 R visitBitOr(HBitOr node); | 10 R visitBitOr(HBitOr node); |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 class HIntegerCheck extends HCheck { | 1112 class HIntegerCheck extends HCheck { |
| 1113 bool alwaysFalse = false; | 1113 bool alwaysFalse = false; |
| 1114 | 1114 |
| 1115 HIntegerCheck(value) : super(<HInstruction>[value]); | 1115 HIntegerCheck(value) : super(<HInstruction>[value]); |
| 1116 | 1116 |
| 1117 HInstruction get value() => inputs[0]; | 1117 HInstruction get value() => inputs[0]; |
| 1118 bool isControlFlow() => true; | 1118 bool isControlFlow() => true; |
| 1119 | 1119 |
| 1120 HType get guaranteedType() => HType.INTEGER; | 1120 HType get guaranteedType() => HType.INTEGER; |
| 1121 | 1121 |
| 1122 HType computeDesiredTypeForInput(HInstruction input, HTypeMap types) { |
| 1123 // If the desired type of the input is already a number, we want |
| 1124 // to specialize it to an integer. |
| 1125 return input.isNumber(types) |
| 1126 ? HType.INTEGER |
| 1127 : super.computeDesiredTypeForInput(input, types); |
| 1128 } |
| 1129 |
| 1122 accept(HVisitor visitor) => visitor.visitIntegerCheck(this); | 1130 accept(HVisitor visitor) => visitor.visitIntegerCheck(this); |
| 1123 int typeCode() => 3; | 1131 int typeCode() => 3; |
| 1124 bool typeEquals(other) => other is HIntegerCheck; | 1132 bool typeEquals(other) => other is HIntegerCheck; |
| 1125 bool dataEquals(HInstruction other) => true; | 1133 bool dataEquals(HInstruction other) => true; |
| 1126 } | 1134 } |
| 1127 | 1135 |
| 1128 class HConditionalBranch extends HControlFlow { | 1136 class HConditionalBranch extends HControlFlow { |
| 1129 HConditionalBranch(inputs) : super(inputs); | 1137 HConditionalBranch(inputs) : super(inputs); |
| 1130 HInstruction get condition() => inputs[0]; | 1138 HInstruction get condition() => inputs[0]; |
| 1131 HBasicBlock get trueBranch() => block.successors[0]; | 1139 HBasicBlock get trueBranch() => block.successors[0]; |
| (...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2743 HBasicBlock get start() => expression.start; | 2751 HBasicBlock get start() => expression.start; |
| 2744 HBasicBlock get end() { | 2752 HBasicBlock get end() { |
| 2745 // We don't create a switch block if there are no cases. | 2753 // We don't create a switch block if there are no cases. |
| 2746 assert(!statements.isEmpty()); | 2754 assert(!statements.isEmpty()); |
| 2747 return statements.last().end; | 2755 return statements.last().end; |
| 2748 } | 2756 } |
| 2749 | 2757 |
| 2750 bool accept(HStatementInformationVisitor visitor) => | 2758 bool accept(HStatementInformationVisitor visitor) => |
| 2751 visitor.visitSwitchInfo(this); | 2759 visitor.visitSwitchInfo(this); |
| 2752 } | 2760 } |
| OLD | NEW |