| 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 abstract class ResolutionWorldBuilder implements WorldBuilder, OpenWorld { | 7 abstract class ResolutionWorldBuilder implements WorldBuilder, OpenWorld { |
| 8 /// Set of all local functions in the program. Used by the mirror tracking | 8 /// Set of all local functions in the program. Used by the mirror tracking |
| 9 /// system to find all live closure instances. | 9 /// system to find all live closure instances. |
| 10 Iterable<Local> get localFunctions; | 10 Iterable<Local> get localFunctions; |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 final SelectorConstraintsStrategy selectorConstraintsStrategy; | 352 final SelectorConstraintsStrategy selectorConstraintsStrategy; |
| 353 | 353 |
| 354 bool hasRuntimeTypeSupport = false; | 354 bool hasRuntimeTypeSupport = false; |
| 355 bool hasIsolateSupport = false; | 355 bool hasIsolateSupport = false; |
| 356 bool hasFunctionApplySupport = false; | 356 bool hasFunctionApplySupport = false; |
| 357 | 357 |
| 358 bool _closed = false; | 358 bool _closed = false; |
| 359 ClosedWorld _closedWorldCache; | 359 ClosedWorld _closedWorldCache; |
| 360 final Set<MemberEntity> _liveInstanceMembers = new Set<MemberEntity>(); | 360 final Set<MemberEntity> _liveInstanceMembers = new Set<MemberEntity>(); |
| 361 | 361 |
| 362 final Set<TypedefElement> _allTypedefs = new Set<TypedefElement>(); | 362 final Set<TypedefEntity> _allTypedefs = new Set<TypedefEntity>(); |
| 363 | 363 |
| 364 final Map<ClassEntity, Set<ClassEntity>> _mixinUses = | 364 final Map<ClassEntity, Set<ClassEntity>> _mixinUses = |
| 365 new Map<ClassEntity, Set<ClassEntity>>(); | 365 new Map<ClassEntity, Set<ClassEntity>>(); |
| 366 | 366 |
| 367 // We keep track of subtype and subclass relationships in four | 367 // We keep track of subtype and subclass relationships in four |
| 368 // distinct sets to make class hierarchy analysis faster. | 368 // distinct sets to make class hierarchy analysis faster. |
| 369 final Map<ClassEntity, ClassHierarchyNode> _classHierarchyNodes = | 369 final Map<ClassEntity, ClassHierarchyNode> _classHierarchyNodes = |
| 370 <ClassEntity, ClassHierarchyNode>{}; | 370 <ClassEntity, ClassHierarchyNode>{}; |
| 371 final Map<ClassEntity, ClassSet> _classSets = <ClassEntity, ClassSet>{}; | 371 final Map<ClassEntity, ClassSet> _classSets = <ClassEntity, ClassSet>{}; |
| 372 | 372 |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 return usage; | 769 return usage; |
| 770 }); | 770 }); |
| 771 } | 771 } |
| 772 | 772 |
| 773 /// Returns an iterable over all mixin applications that mixin [cls]. | 773 /// Returns an iterable over all mixin applications that mixin [cls]. |
| 774 Iterable<ClassEntity> allMixinUsesOf(ClassEntity cls) { | 774 Iterable<ClassEntity> allMixinUsesOf(ClassEntity cls) { |
| 775 Iterable<ClassEntity> uses = _mixinUses[cls]; | 775 Iterable<ClassEntity> uses = _mixinUses[cls]; |
| 776 return uses != null ? uses : const <ClassEntity>[]; | 776 return uses != null ? uses : const <ClassEntity>[]; |
| 777 } | 777 } |
| 778 | 778 |
| 779 void registerTypedef(TypedefElement typdef) { | 779 void registerTypedef(TypedefEntity typdef) { |
| 780 _allTypedefs.add(typdef); | 780 _allTypedefs.add(typdef); |
| 781 } | 781 } |
| 782 | 782 |
| 783 void registerMixinUse( | 783 void registerMixinUse( |
| 784 covariant ClassEntity mixinApplication, covariant ClassEntity mixin) { | 784 covariant ClassEntity mixinApplication, covariant ClassEntity mixin) { |
| 785 // TODO(johnniwinther): Add map restricted to live classes. | 785 // TODO(johnniwinther): Add map restricted to live classes. |
| 786 // We don't support patch classes as mixin. | 786 // We don't support patch classes as mixin. |
| 787 Set<ClassEntity> users = | 787 Set<ClassEntity> users = |
| 788 _mixinUses.putIfAbsent(mixin, () => new Set<ClassEntity>()); | 788 _mixinUses.putIfAbsent(mixin, () => new Set<ClassEntity>()); |
| 789 users.add(mixinApplication); | 789 users.add(mixinApplication); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 typesImplementedBySubclasses: typesImplementedBySubclasses, | 1008 typesImplementedBySubclasses: typesImplementedBySubclasses, |
| 1009 classHierarchyNodes: _classHierarchyNodes, | 1009 classHierarchyNodes: _classHierarchyNodes, |
| 1010 classSets: _classSets); | 1010 classSets: _classSets); |
| 1011 } | 1011 } |
| 1012 | 1012 |
| 1013 @override | 1013 @override |
| 1014 void registerClass(ClassEntity cls) { | 1014 void registerClass(ClassEntity cls) { |
| 1015 throw new UnimplementedError('KernelResolutionWorldBuilder.registerClass'); | 1015 throw new UnimplementedError('KernelResolutionWorldBuilder.registerClass'); |
| 1016 } | 1016 } |
| 1017 } | 1017 } |
| OLD | NEW |