| 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 part of world_builder; | 5 part of world_builder; |
| 6 | 6 |
| 7 /// [ResolutionEnqueuerWorldBuilder] based on the [Element] model. | 7 /// [ResolutionEnqueuerWorldBuilder] based on the [Element] model. |
| 8 class ElementResolutionWorldBuilder extends ResolutionWorldBuilderBase { | 8 class ElementResolutionWorldBuilder extends ResolutionWorldBuilderBase { |
| 9 /// Used for testing the new more precise computation of instantiated types | 9 /// Used for testing the new more precise computation of instantiated types |
| 10 /// and classes. | 10 /// and classes. |
| 11 static bool useInstantiationMap = false; | 11 static bool useInstantiationMap = false; |
| 12 | 12 |
| 13 final Resolution _resolution; | 13 final Resolution _resolution; |
| 14 | 14 |
| 15 ElementResolutionWorldBuilder( | 15 ElementResolutionWorldBuilder( |
| 16 JavaScriptBackend backend, | 16 JavaScriptBackend backend, |
| 17 this._resolution, | 17 this._resolution, |
| 18 NativeBasicData nativeBasicData, | 18 NativeBasicData nativeBasicData, |
| 19 NativeDataBuilder nativeDataBuilder, | 19 NativeDataBuilder nativeDataBuilder, |
| 20 InterceptorDataBuilder interceptorDataBuilder, | 20 InterceptorDataBuilder interceptorDataBuilder, |
| 21 BackendUsageBuilder backendUsageBuilder, | 21 BackendUsageBuilder backendUsageBuilder, |
| 22 SelectorConstraintsStrategy selectorConstraintsStrategy) | 22 SelectorConstraintsStrategy selectorConstraintsStrategy) |
| 23 : super( | 23 : super( |
| 24 _resolution.elementEnvironment, | 24 _resolution.elementEnvironment, |
| 25 _resolution.types, |
| 25 _resolution.commonElements, | 26 _resolution.commonElements, |
| 26 backend.constantSystem, | 27 backend.constantSystem, |
| 27 nativeBasicData, | 28 nativeBasicData, |
| 28 nativeDataBuilder, | 29 nativeDataBuilder, |
| 29 interceptorDataBuilder, | 30 interceptorDataBuilder, |
| 30 backendUsageBuilder, | 31 backendUsageBuilder, |
| 31 selectorConstraintsStrategy); | 32 selectorConstraintsStrategy); |
| 32 | 33 |
| 33 bool isImplemented(ClassElement cls) { | 34 bool isImplemented(ClassElement cls) { |
| 34 return super.isImplemented(cls.declaration); | 35 return super.isImplemented(cls.declaration); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 170 |
| 170 @override | 171 @override |
| 171 Iterable<InterfaceType> getSupertypes(ClassElement cls) => cls.allSupertypes; | 172 Iterable<InterfaceType> getSupertypes(ClassElement cls) => cls.allSupertypes; |
| 172 | 173 |
| 173 ClosedWorld closeWorld() { | 174 ClosedWorld closeWorld() { |
| 174 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses = | 175 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses = |
| 175 populateHierarchyNodes(); | 176 populateHierarchyNodes(); |
| 176 _closed = true; | 177 _closed = true; |
| 177 return _closedWorldCache = new ClosedWorldImpl( | 178 return _closedWorldCache = new ClosedWorldImpl( |
| 178 elementEnvironment: _elementEnvironment, | 179 elementEnvironment: _elementEnvironment, |
| 180 dartTypes: _dartTypes, |
| 179 commonElements: _commonElements, | 181 commonElements: _commonElements, |
| 180 constantSystem: _constantSystem, | 182 constantSystem: _constantSystem, |
| 181 nativeData: _nativeDataBuilder.close(), | 183 nativeData: _nativeDataBuilder.close(), |
| 182 interceptorData: _interceptorDataBuilder.close(), | 184 interceptorData: _interceptorDataBuilder.close(), |
| 183 backendUsage: _backendUsageBuilder.close(), | 185 backendUsage: _backendUsageBuilder.close(), |
| 184 resolutionWorldBuilder: this, | 186 resolutionWorldBuilder: this, |
| 185 implementedClasses: _implementedClasses, | 187 implementedClasses: _implementedClasses, |
| 186 functionSet: _allFunctions.close(), | 188 functionSet: _allFunctions.close(), |
| 187 allTypedefs: _allTypedefs, | 189 allTypedefs: _allTypedefs, |
| 188 mixinUses: _mixinUses, | 190 mixinUses: _mixinUses, |
| 189 typesImplementedBySubclasses: typesImplementedBySubclasses, | 191 typesImplementedBySubclasses: typesImplementedBySubclasses, |
| 190 classHierarchyNodes: _classHierarchyNodes, | 192 classHierarchyNodes: _classHierarchyNodes, |
| 191 classSets: _classSets); | 193 classSets: _classSets); |
| 192 } | 194 } |
| 193 | 195 |
| 194 @override | 196 @override |
| 195 void registerMixinUse( | 197 void registerMixinUse( |
| 196 MixinApplicationElement mixinApplication, ClassElement mixin) { | 198 MixinApplicationElement mixinApplication, ClassElement mixin) { |
| 197 assert(mixin.isDeclaration); | 199 assert(mixin.isDeclaration); |
| 198 super.registerMixinUse(mixinApplication, mixin); | 200 super.registerMixinUse(mixinApplication, mixin); |
| 199 } | 201 } |
| 200 } | 202 } |
| OLD | NEW |