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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 } | 757 } |
758 | 758 |
759 void registerMixinUse(ClassEntity mixinApplication, ClassEntity mixin) { | 759 void registerMixinUse(ClassEntity mixinApplication, ClassEntity mixin) { |
760 // TODO(johnniwinther): Add map restricted to live classes. | 760 // TODO(johnniwinther): Add map restricted to live classes. |
761 // We don't support patch classes as mixin. | 761 // We don't support patch classes as mixin. |
762 Set<ClassEntity> users = | 762 Set<ClassEntity> users = |
763 _mixinUses.putIfAbsent(mixin, () => new Set<ClassEntity>()); | 763 _mixinUses.putIfAbsent(mixin, () => new Set<ClassEntity>()); |
764 users.add(mixinApplication); | 764 users.add(mixinApplication); |
765 } | 765 } |
766 | 766 |
| 767 void registerUsedElement(MemberEntity element) { |
| 768 if (element.isInstanceMember && !element.isAbstract) { |
| 769 _allFunctions.add(element); |
| 770 } |
| 771 } |
| 772 |
767 ClosedWorld get closedWorldCache { | 773 ClosedWorld get closedWorldCache { |
768 assert(isClosed); | 774 assert(isClosed); |
769 return _closedWorldCache; | 775 return _closedWorldCache; |
770 } | 776 } |
771 | 777 |
772 @override | 778 @override |
773 bool isMemberUsed(MemberEntity member) { | 779 bool isMemberUsed(MemberEntity member) { |
774 if (member.isInstanceMember) { | 780 if (member.isInstanceMember) { |
775 _MemberUsage usage = _instanceMemberUsage[member]; | 781 _MemberUsage usage = _instanceMemberUsage[member]; |
776 if (usage != null && usage.hasUse) return true; | 782 if (usage != null && usage.hasUse) return true; |
777 } | 783 } |
778 _StaticMemberUsage usage = _staticMemberUsage[member]; | 784 _StaticMemberUsage usage = _staticMemberUsage[member]; |
779 return usage != null && usage.hasUse; | 785 return usage != null && usage.hasUse; |
780 } | 786 } |
781 } | 787 } |
OLD | NEW |