| 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 JavaScriptBackend _backend; | 13 final JavaScriptBackend _backend; |
| 14 final Resolution _resolution; | 14 final Resolution _resolution; |
| 15 | 15 |
| 16 ElementResolutionWorldBuilder( | 16 ElementResolutionWorldBuilder( |
| 17 this._backend, | 17 this._backend, |
| 18 this._resolution, | 18 this._resolution, |
| 19 NativeBasicData nativeBasicData, | 19 NativeBasicData nativeBasicData, |
| 20 NativeDataBuilder nativeDataBuilder, | 20 NativeDataBuilder nativeDataBuilder, |
| 21 InterceptorDataBuilder interceptorDataBuilder, | 21 InterceptorDataBuilder interceptorDataBuilder, |
| 22 BackendUsageBuilder backendUsageBuilder, |
| 22 SelectorConstraintsStrategy selectorConstraintsStrategy) | 23 SelectorConstraintsStrategy selectorConstraintsStrategy) |
| 23 : super( | 24 : super( |
| 24 _backend.compiler.elementEnvironment, | 25 _backend.compiler.elementEnvironment, |
| 25 _resolution.commonElements, | 26 _resolution.commonElements, |
| 26 nativeBasicData, | 27 nativeBasicData, |
| 27 nativeDataBuilder, | 28 nativeDataBuilder, |
| 28 interceptorDataBuilder, | 29 interceptorDataBuilder, |
| 30 backendUsageBuilder, |
| 29 selectorConstraintsStrategy); | 31 selectorConstraintsStrategy); |
| 30 | 32 |
| 31 bool isImplemented(ClassElement cls) { | 33 bool isImplemented(ClassElement cls) { |
| 32 return super.isImplemented(cls.declaration); | 34 return super.isImplemented(cls.declaration); |
| 33 } | 35 } |
| 34 | 36 |
| 35 void registerTypeInstantiation( | 37 void registerTypeInstantiation( |
| 36 InterfaceType type, ClassUsedCallback classUsed, | 38 InterfaceType type, ClassUsedCallback classUsed, |
| 37 {ConstructorEntity constructor, | 39 {ConstructorEntity constructor, |
| 38 bool byMirrors: false, | 40 bool byMirrors: false, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 170 |
| 169 ClosedWorld closeWorld() { | 171 ClosedWorld closeWorld() { |
| 170 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses = | 172 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses = |
| 171 populateHierarchyNodes(); | 173 populateHierarchyNodes(); |
| 172 _closed = true; | 174 _closed = true; |
| 173 return _closedWorldCache = new ClosedWorldImpl( | 175 return _closedWorldCache = new ClosedWorldImpl( |
| 174 commonElements: _commonElements, | 176 commonElements: _commonElements, |
| 175 constantSystem: _backend.constantSystem, | 177 constantSystem: _backend.constantSystem, |
| 176 nativeData: _nativeDataBuilder.close(), | 178 nativeData: _nativeDataBuilder.close(), |
| 177 interceptorData: _interceptorDataBuilder.close(), | 179 interceptorData: _interceptorDataBuilder.close(), |
| 178 backendUsage: _backend.backendUsage, | 180 backendUsage: _backendUsageBuilder.close(), |
| 179 resolutionWorldBuilder: this, | 181 resolutionWorldBuilder: this, |
| 180 functionSet: _allFunctions.close(), | 182 functionSet: _allFunctions.close(), |
| 181 allTypedefs: _allTypedefs, | 183 allTypedefs: _allTypedefs, |
| 182 mixinUses: _mixinUses, | 184 mixinUses: _mixinUses, |
| 183 typesImplementedBySubclasses: typesImplementedBySubclasses, | 185 typesImplementedBySubclasses: typesImplementedBySubclasses, |
| 184 classHierarchyNodes: _classHierarchyNodes, | 186 classHierarchyNodes: _classHierarchyNodes, |
| 185 classSets: _classSets); | 187 classSets: _classSets); |
| 186 } | 188 } |
| 187 | 189 |
| 188 @override | 190 @override |
| 189 void registerMixinUse( | 191 void registerMixinUse( |
| 190 MixinApplicationElement mixinApplication, ClassElement mixin) { | 192 MixinApplicationElement mixinApplication, ClassElement mixin) { |
| 191 assert(mixin.isDeclaration); | 193 assert(mixin.isDeclaration); |
| 192 super.registerMixinUse(mixinApplication, mixin); | 194 super.registerMixinUse(mixinApplication, mixin); |
| 193 } | 195 } |
| 194 } | 196 } |
| OLD | NEW |