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 import '../closure.dart'; | 5 import '../closure.dart'; |
6 import '../common.dart'; | 6 import '../common.dart'; |
7 import '../compiler.dart' show Compiler; | 7 import '../compiler.dart' show Compiler; |
8 import '../constants/constant_system.dart'; | 8 import '../constants/constant_system.dart'; |
9 import '../constants/values.dart'; | 9 import '../constants/values.dart'; |
10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
(...skipping 2247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2258 sourceElement = variable; | 2258 sourceElement = variable; |
2259 } | 2259 } |
2260 | 2260 |
2261 toString() => 'local ${sourceElement.name}'; | 2261 toString() => 'local ${sourceElement.name}'; |
2262 accept(HVisitor visitor) => visitor.visitLocalValue(this); | 2262 accept(HVisitor visitor) => visitor.visitLocalValue(this); |
2263 } | 2263 } |
2264 | 2264 |
2265 class HParameterValue extends HLocalValue { | 2265 class HParameterValue extends HLocalValue { |
2266 HParameterValue(Entity variable, type) : super(variable, type); | 2266 HParameterValue(Entity variable, type) : super(variable, type); |
2267 | 2267 |
| 2268 // [HParameterValue]s are either the value of the parameter (in fully SSA |
| 2269 // converted code), or the mutable variable containing the value (in |
| 2270 // incompletely SSA converted code, e.g. methods containing exceptions). |
| 2271 bool usedAsVariable() { |
| 2272 for (HInstruction user in usedBy) { |
| 2273 if (user is HLocalGet) return true; |
| 2274 if (user is HLocalSet && user.local == this) return true; |
| 2275 } |
| 2276 return false; |
| 2277 } |
| 2278 |
2268 toString() => 'parameter ${sourceElement.name}'; | 2279 toString() => 'parameter ${sourceElement.name}'; |
2269 accept(HVisitor visitor) => visitor.visitParameterValue(this); | 2280 accept(HVisitor visitor) => visitor.visitParameterValue(this); |
2270 } | 2281 } |
2271 | 2282 |
2272 class HThis extends HParameterValue { | 2283 class HThis extends HParameterValue { |
2273 HThis(ThisLocal element, TypeMask type) : super(element, type); | 2284 HThis(ThisLocal element, TypeMask type) : super(element, type); |
2274 | 2285 |
2275 ThisLocal get sourceElement => super.sourceElement; | 2286 ThisLocal get sourceElement => super.sourceElement; |
2276 | 2287 |
2277 accept(HVisitor visitor) => visitor.visitThis(this); | 2288 accept(HVisitor visitor) => visitor.visitThis(this); |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3261 class HDynamicType extends HRuntimeType { | 3272 class HDynamicType extends HRuntimeType { |
3262 HDynamicType(DynamicType dartType, TypeMask instructionType) | 3273 HDynamicType(DynamicType dartType, TypeMask instructionType) |
3263 : super(const <HInstruction>[], dartType, instructionType); | 3274 : super(const <HInstruction>[], dartType, instructionType); |
3264 | 3275 |
3265 accept(HVisitor visitor) => visitor.visitDynamicType(this); | 3276 accept(HVisitor visitor) => visitor.visitDynamicType(this); |
3266 | 3277 |
3267 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; | 3278 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; |
3268 | 3279 |
3269 bool typeEquals(HInstruction other) => other is HDynamicType; | 3280 bool typeEquals(HInstruction other) => other is HDynamicType; |
3270 } | 3281 } |
OLD | NEW |