| 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 '../common/backend_api.dart' show BackendClasses; | 7 import '../common/backend_api.dart' show BackendClasses; |
| 8 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
| 9 import '../constants/constant_system.dart'; | 9 import '../constants/constant_system.dart'; |
| 10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 209 |
| 210 HConstant addConstant(ConstantValue constant, Compiler compiler, | 210 HConstant addConstant(ConstantValue constant, Compiler compiler, |
| 211 {SourceInformation sourceInformation}) { | 211 {SourceInformation sourceInformation}) { |
| 212 HConstant result = constants[constant]; | 212 HConstant result = constants[constant]; |
| 213 // TODO(johnniwinther): Support source information per constant reference. | 213 // TODO(johnniwinther): Support source information per constant reference. |
| 214 if (result == null) { | 214 if (result == null) { |
| 215 if (!constant.isConstant) { | 215 if (!constant.isConstant) { |
| 216 // We use `null` as the value for invalid constant expressions. | 216 // We use `null` as the value for invalid constant expressions. |
| 217 constant = const NullConstantValue(); | 217 constant = const NullConstantValue(); |
| 218 } | 218 } |
| 219 TypeMask type = computeTypeMask(compiler, constant); | 219 TypeMask type = |
| 220 computeTypeMask(compiler.closedWorld, compiler.backend, constant); |
| 220 result = new HConstant.internal(constant, type) | 221 result = new HConstant.internal(constant, type) |
| 221 ..sourceInformation = sourceInformation; | 222 ..sourceInformation = sourceInformation; |
| 222 entry.addAtExit(result); | 223 entry.addAtExit(result); |
| 223 constants[constant] = result; | 224 constants[constant] = result; |
| 224 } else if (result.block == null) { | 225 } else if (result.block == null) { |
| 225 // The constant was not used anymore. | 226 // The constant was not used anymore. |
| 226 entry.addAtExit(result); | 227 entry.addAtExit(result); |
| 227 } | 228 } |
| 228 return result; | 229 return result; |
| 229 } | 230 } |
| (...skipping 3217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3447 class HDynamicType extends HRuntimeType { | 3448 class HDynamicType extends HRuntimeType { |
| 3448 HDynamicType(DynamicType dartType, TypeMask instructionType) | 3449 HDynamicType(DynamicType dartType, TypeMask instructionType) |
| 3449 : super(const <HInstruction>[], dartType, instructionType); | 3450 : super(const <HInstruction>[], dartType, instructionType); |
| 3450 | 3451 |
| 3451 accept(HVisitor visitor) => visitor.visitDynamicType(this); | 3452 accept(HVisitor visitor) => visitor.visitDynamicType(this); |
| 3452 | 3453 |
| 3453 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; | 3454 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; |
| 3454 | 3455 |
| 3455 bool typeEquals(HInstruction other) => other is HDynamicType; | 3456 bool typeEquals(HInstruction other) => other is HDynamicType; |
| 3456 } | 3457 } |
| OLD | NEW |