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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 _instanceMemberUsage.putIfAbsent(member, () { | 705 _instanceMemberUsage.putIfAbsent(member, () { |
706 bool isNative = _nativeBasicData.isNativeClass(cls); | 706 bool isNative = _nativeBasicData.isNativeClass(cls); |
707 _MemberUsage usage = new _MemberUsage(member, isNative: isNative); | 707 _MemberUsage usage = new _MemberUsage(member, isNative: isNative); |
708 EnumSet<MemberUse> useSet = new EnumSet<MemberUse>(); | 708 EnumSet<MemberUse> useSet = new EnumSet<MemberUse>(); |
709 useSet.addAll(usage.appliedUse); | 709 useSet.addAll(usage.appliedUse); |
710 if (member.isField && isNative) { | 710 if (member.isField && isNative) { |
711 registerUsedElement(member); | 711 registerUsedElement(member); |
712 } | 712 } |
713 if (member.isFunction && | 713 if (member.isFunction && |
714 member.name == Identifiers.call && | 714 member.name == Identifiers.call && |
715 _elementEnvironment.getThisType(cls).typeArguments.isNotEmpty) { | 715 _elementEnvironment.isGenericClass(cls)) { |
716 closurizedMembersWithFreeTypeVariables.add(member); | 716 closurizedMembersWithFreeTypeVariables.add(member); |
717 } | 717 } |
718 | 718 |
719 if (_hasInvokedGetter(member)) { | 719 if (_hasInvokedGetter(member)) { |
720 useSet.addAll(usage.read()); | 720 useSet.addAll(usage.read()); |
721 } | 721 } |
722 if (_hasInvocation(member)) { | 722 if (_hasInvocation(member)) { |
723 useSet.addAll(usage.invoke()); | 723 useSet.addAll(usage.invoke()); |
724 } | 724 } |
725 if (hasInvokedSetter(member)) { | 725 if (hasInvokedSetter(member)) { |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 typesImplementedBySubclasses: typesImplementedBySubclasses, | 939 typesImplementedBySubclasses: typesImplementedBySubclasses, |
940 classHierarchyNodes: _classHierarchyNodes, | 940 classHierarchyNodes: _classHierarchyNodes, |
941 classSets: _classSets); | 941 classSets: _classSets); |
942 } | 942 } |
943 | 943 |
944 @override | 944 @override |
945 void registerClass(ClassEntity cls) { | 945 void registerClass(ClassEntity cls) { |
946 throw new UnimplementedError('KernelResolutionWorldBuilder.registerClass'); | 946 throw new UnimplementedError('KernelResolutionWorldBuilder.registerClass'); |
947 } | 947 } |
948 } | 948 } |
OLD | NEW |