| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 library dart2js.kernel.element_map; | 5 library dart2js.kernel.element_map; |
| 6 | 6 |
| 7 import 'package:kernel/ast.dart' as ir; | 7 import 'package:kernel/ast.dart' as ir; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/names.dart' show Identifiers; | 10 import '../common/names.dart' show Identifiers; |
| 11 import '../common/resolution.dart'; | 11 import '../common/resolution.dart'; |
| 12 import '../compile_time_constants.dart'; | 12 import '../compile_time_constants.dart'; |
| 13 import '../constants/constant_system.dart'; | 13 import '../constants/constant_system.dart'; |
| 14 import '../constants/constructors.dart'; | 14 import '../constants/constructors.dart'; |
| 15 import '../constants/evaluation.dart'; | 15 import '../constants/evaluation.dart'; |
| 16 import '../constants/expressions.dart'; | 16 import '../constants/expressions.dart'; |
| 17 import '../constants/values.dart'; | 17 import '../constants/values.dart'; |
| 18 import '../common_elements.dart'; | 18 import '../common_elements.dart'; |
| 19 import '../elements/elements.dart'; | 19 import '../elements/elements.dart'; |
| 20 import '../elements/entities.dart'; | 20 import '../elements/entities.dart'; |
| 21 import '../elements/names.dart'; | 21 import '../elements/names.dart'; |
| 22 import '../elements/types.dart'; | 22 import '../elements/types.dart'; |
| 23 import '../environment.dart'; | 23 import '../environment.dart'; |
| 24 import '../frontend_strategy.dart'; | 24 import '../frontend_strategy.dart'; |
| 25 import '../js_backend/constant_system_javascript.dart'; | 25 import '../js_backend/constant_system_javascript.dart'; |
| 26 import '../js_backend/interceptor_data.dart'; |
| 26 import '../js_backend/native_data.dart'; | 27 import '../js_backend/native_data.dart'; |
| 27 import '../js_backend/no_such_method_registry.dart'; | 28 import '../js_backend/no_such_method_registry.dart'; |
| 28 import '../native/native.dart' as native; | 29 import '../native/native.dart' as native; |
| 29 import '../native/resolver.dart'; | 30 import '../native/resolver.dart'; |
| 30 import '../ordered_typeset.dart'; | 31 import '../ordered_typeset.dart'; |
| 31 import '../ssa/kernel_impact.dart'; | 32 import '../ssa/kernel_impact.dart'; |
| 32 import '../universe/call_structure.dart'; | 33 import '../universe/call_structure.dart'; |
| 33 import '../universe/world_builder.dart'; | 34 import '../universe/world_builder.dart'; |
| 34 import '../util/util.dart' show Link, LinkBuilder; | 35 import '../util/util.dart' show Link, LinkBuilder; |
| 35 import 'element_map.dart'; | 36 import 'element_map.dart'; |
| (...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1243 } | 1244 } |
| 1244 } | 1245 } |
| 1245 | 1246 |
| 1246 class KernelResolutionWorldBuilder extends KernelResolutionWorldBuilderBase { | 1247 class KernelResolutionWorldBuilder extends KernelResolutionWorldBuilderBase { |
| 1247 final KernelToElementMapImpl elementMap; | 1248 final KernelToElementMapImpl elementMap; |
| 1248 | 1249 |
| 1249 KernelResolutionWorldBuilder( | 1250 KernelResolutionWorldBuilder( |
| 1250 this.elementMap, | 1251 this.elementMap, |
| 1251 NativeBasicData nativeBasicData, | 1252 NativeBasicData nativeBasicData, |
| 1252 NativeDataBuilder nativeDataBuilder, | 1253 NativeDataBuilder nativeDataBuilder, |
| 1254 InterceptorDataBuilder interceptorDataBuilder, |
| 1253 SelectorConstraintsStrategy selectorConstraintsStrategy) | 1255 SelectorConstraintsStrategy selectorConstraintsStrategy) |
| 1254 : super(elementMap.elementEnvironment, elementMap.commonElements, | 1256 : super( |
| 1255 nativeBasicData, nativeDataBuilder, selectorConstraintsStrategy); | 1257 elementMap.elementEnvironment, |
| 1258 elementMap.commonElements, |
| 1259 nativeBasicData, |
| 1260 nativeDataBuilder, |
| 1261 interceptorDataBuilder, |
| 1262 selectorConstraintsStrategy); |
| 1256 | 1263 |
| 1257 @override | 1264 @override |
| 1258 Iterable<InterfaceType> getSupertypes(ClassEntity cls) { | 1265 Iterable<InterfaceType> getSupertypes(ClassEntity cls) { |
| 1259 return elementMap._getOrderedTypeSet(cls).supertypes; | 1266 return elementMap._getOrderedTypeSet(cls).supertypes; |
| 1260 } | 1267 } |
| 1261 | 1268 |
| 1262 @override | 1269 @override |
| 1263 ClassEntity getSuperClass(ClassEntity cls) { | 1270 ClassEntity getSuperClass(ClassEntity cls) { |
| 1264 return elementMap._getSuperType(cls)?.element; | 1271 return elementMap._getSuperType(cls)?.element; |
| 1265 } | 1272 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1306 } | 1313 } |
| 1307 | 1314 |
| 1308 InterfaceType getMixinTypeForClass(KClass cls) { | 1315 InterfaceType getMixinTypeForClass(KClass cls) { |
| 1309 _KClassEnv env = elementMap._classEnvs[cls.classIndex]; | 1316 _KClassEnv env = elementMap._classEnvs[cls.classIndex]; |
| 1310 ir.Supertype mixedInType = env.cls.mixedInType; | 1317 ir.Supertype mixedInType = env.cls.mixedInType; |
| 1311 if (mixedInType == null) return null; | 1318 if (mixedInType == null) return null; |
| 1312 return elementMap.createInterfaceType( | 1319 return elementMap.createInterfaceType( |
| 1313 mixedInType.classNode, mixedInType.typeArguments); | 1320 mixedInType.classNode, mixedInType.typeArguments); |
| 1314 } | 1321 } |
| 1315 } | 1322 } |
| OLD | NEW |