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

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

Issue 2804293002: Add MemberEntity.isAbstract and use MemberEntity in function_set.dart (Closed)
Patch Set: Inference doesn't like MemberEntity 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
« no previous file with comments | « pkg/compiler/lib/src/universe/function_set.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/universe/function_set.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698