| 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. |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 super._processInstantiatedClassMember(cls, member, memberUsed); | 122 super._processInstantiatedClassMember(cls, member, memberUsed); |
| 123 } | 123 } |
| 124 | 124 |
| 125 ClassHierarchyNode _ensureClassHierarchyNode(ClassElement cls) { | 125 ClassHierarchyNode _ensureClassHierarchyNode(ClassElement cls) { |
| 126 cls = cls.declaration; | 126 cls = cls.declaration; |
| 127 return _classHierarchyNodes.putIfAbsent(cls, () { | 127 return _classHierarchyNodes.putIfAbsent(cls, () { |
| 128 ClassHierarchyNode parentNode; | 128 ClassHierarchyNode parentNode; |
| 129 if (cls.superclass != null) { | 129 if (cls.superclass != null) { |
| 130 parentNode = _ensureClassHierarchyNode(cls.superclass); | 130 parentNode = _ensureClassHierarchyNode(cls.superclass); |
| 131 } | 131 } |
| 132 return new ClassHierarchyNode(parentNode, cls); | 132 return new ClassHierarchyNode(parentNode, cls, cls.hierarchyDepth); |
| 133 }); | 133 }); |
| 134 } | 134 } |
| 135 | 135 |
| 136 ClassSet _ensureClassSet(ClassElement cls) { | 136 ClassSet _ensureClassSet(ClassElement cls) { |
| 137 cls = cls.declaration; | 137 cls = cls.declaration; |
| 138 return _classSets.putIfAbsent(cls, () { | 138 return _classSets.putIfAbsent(cls, () { |
| 139 ClassHierarchyNode node = _ensureClassHierarchyNode(cls); | 139 ClassHierarchyNode node = _ensureClassHierarchyNode(cls); |
| 140 ClassSet classSet = new ClassSet(node); | 140 ClassSet classSet = new ClassSet(node); |
| 141 | 141 |
| 142 for (ResolutionInterfaceType type in cls.allSupertypes) { | 142 for (ResolutionInterfaceType type in cls.allSupertypes) { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 classSets: _classSets); | 237 classSets: _classSets); |
| 238 } | 238 } |
| 239 | 239 |
| 240 @override | 240 @override |
| 241 void registerMixinUse( | 241 void registerMixinUse( |
| 242 MixinApplicationElement mixinApplication, ClassElement mixin) { | 242 MixinApplicationElement mixinApplication, ClassElement mixin) { |
| 243 assert(mixin.isDeclaration); | 243 assert(mixin.isDeclaration); |
| 244 super.registerMixinUse(mixinApplication, mixin); | 244 super.registerMixinUse(mixinApplication, mixin); |
| 245 } | 245 } |
| 246 } | 246 } |
| OLD | NEW |