Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: pkg/compiler/lib/src/universe/element_world_builder.dart

Issue 2814663002: Use ClassEntity in ClassHierarchyNode (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698