| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 return new HBoundedType.exact(objectConstant.type); | 173 return new HBoundedType.exact(objectConstant.type); |
| 174 } | 174 } |
| 175 | 175 |
| 176 HConstant addConstant(Constant constant) { | 176 HConstant addConstant(Constant constant) { |
| 177 HConstant result = constants[constant]; | 177 HConstant result = constants[constant]; |
| 178 if (result == null) { | 178 if (result == null) { |
| 179 HType type = mapConstantTypeToSsaType(constant); | 179 HType type = mapConstantTypeToSsaType(constant); |
| 180 result = new HConstant.internal(constant, type); | 180 result = new HConstant.internal(constant, type); |
| 181 entry.addAtExit(result); | 181 entry.addAtExit(result); |
| 182 constants[constant] = result; | 182 constants[constant] = result; |
| 183 } else if (result.block == null) { |
| 184 // The constant was not used anymore. |
| 185 entry.addAtExit(result); |
| 183 } | 186 } |
| 184 return result; | 187 return result; |
| 185 } | 188 } |
| 186 | 189 |
| 187 HConstant addConstantInt(int i, ConstantSystem constantSystem) { | 190 HConstant addConstantInt(int i, ConstantSystem constantSystem) { |
| 188 return addConstant(constantSystem.createInt(i)); | 191 return addConstant(constantSystem.createInt(i)); |
| 189 } | 192 } |
| 190 | 193 |
| 191 HConstant addConstantDouble(double d, ConstantSystem constantSystem) { | 194 HConstant addConstantDouble(double d, ConstantSystem constantSystem) { |
| 192 return addConstant(constantSystem.createDouble(d)); | 195 return addConstant(constantSystem.createDouble(d)); |
| (...skipping 2749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2942 HBasicBlock get start => expression.start; | 2945 HBasicBlock get start => expression.start; |
| 2943 HBasicBlock get end { | 2946 HBasicBlock get end { |
| 2944 // We don't create a switch block if there are no cases. | 2947 // We don't create a switch block if there are no cases. |
| 2945 assert(!statements.isEmpty); | 2948 assert(!statements.isEmpty); |
| 2946 return statements.last.end; | 2949 return statements.last.end; |
| 2947 } | 2950 } |
| 2948 | 2951 |
| 2949 bool accept(HStatementInformationVisitor visitor) => | 2952 bool accept(HStatementInformationVisitor visitor) => |
| 2950 visitor.visitSwitchInfo(this); | 2953 visitor.visitSwitchInfo(this); |
| 2951 } | 2954 } |
| OLD | NEW |