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 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 // Use the [:seenClasses:] set to include non-instantiated | 921 // Use the [:seenClasses:] set to include non-instantiated |
922 // classes: if the superclass of these classes require RTI, then | 922 // classes: if the superclass of these classes require RTI, then |
923 // they also need RTI, so that a constructor passes the type | 923 // they also need RTI, so that a constructor passes the type |
924 // variables to the super constructor. | 924 // variables to the super constructor. |
925 forEachInstantiatedClass(addSubtypes); | 925 forEachInstantiatedClass(addSubtypes); |
926 | 926 |
927 _classHierarchyNodes.keys.toList().forEach(_ensureClassSet); | 927 _classHierarchyNodes.keys.toList().forEach(_ensureClassSet); |
928 | 928 |
929 return typesImplementedBySubclasses; | 929 return typesImplementedBySubclasses; |
930 } | 930 } |
| 931 |
| 932 Iterable<MemberEntity> computeAssignedInstanceMembers() { |
| 933 Set<MemberEntity> assignedInstanceMembers = new Set<MemberEntity>(); |
| 934 for (MemberEntity instanceMember in _liveInstanceMembers) { |
| 935 if (hasInvokedSetter(instanceMember)) { |
| 936 assignedInstanceMembers.add(instanceMember); |
| 937 } |
| 938 } |
| 939 assignedInstanceMembers.addAll(fieldSetters); |
| 940 return assignedInstanceMembers; |
| 941 } |
931 } | 942 } |
932 | 943 |
933 abstract class KernelResolutionWorldBuilderBase | 944 abstract class KernelResolutionWorldBuilderBase |
934 extends ResolutionWorldBuilderBase { | 945 extends ResolutionWorldBuilderBase { |
935 KernelToElementMapForImpactImpl get elementMap; | 946 KernelToElementMapForImpactImpl get elementMap; |
936 | 947 |
937 KernelResolutionWorldBuilderBase( | 948 KernelResolutionWorldBuilderBase( |
938 ElementEnvironment elementEnvironment, | 949 ElementEnvironment elementEnvironment, |
939 DartTypes dartTypes, | 950 DartTypes dartTypes, |
940 CommonElements commonElements, | 951 CommonElements commonElements, |
(...skipping 25 matching lines...) Expand all Loading... |
966 "ClassHierarchyNode/ClassSet mismatch: " | 977 "ClassHierarchyNode/ClassSet mismatch: " |
967 "$_classHierarchyNodes vs $_classSets"); | 978 "$_classHierarchyNodes vs $_classSets"); |
968 return _closedWorldCache = new KernelClosedWorld(elementMap, | 979 return _closedWorldCache = new KernelClosedWorld(elementMap, |
969 elementEnvironment: _elementEnvironment, | 980 elementEnvironment: _elementEnvironment, |
970 dartTypes: _dartTypes, | 981 dartTypes: _dartTypes, |
971 commonElements: _commonElements, | 982 commonElements: _commonElements, |
972 nativeData: _nativeDataBuilder.close(), | 983 nativeData: _nativeDataBuilder.close(), |
973 interceptorData: _interceptorDataBuilder.close(), | 984 interceptorData: _interceptorDataBuilder.close(), |
974 backendUsage: _backendUsageBuilder.close(), | 985 backendUsage: _backendUsageBuilder.close(), |
975 constantSystem: _constantSystem, | 986 constantSystem: _constantSystem, |
976 resolutionWorldBuilder: this, | |
977 implementedClasses: _implementedClasses, | 987 implementedClasses: _implementedClasses, |
978 liveInstanceMembers: _liveInstanceMembers, | 988 liveInstanceMembers: _liveInstanceMembers, |
| 989 assignedInstanceMembers: computeAssignedInstanceMembers(), |
979 allTypedefs: _allTypedefs, | 990 allTypedefs: _allTypedefs, |
980 mixinUses: _mixinUses, | 991 mixinUses: _mixinUses, |
981 typesImplementedBySubclasses: typesImplementedBySubclasses, | 992 typesImplementedBySubclasses: typesImplementedBySubclasses, |
982 classHierarchyNodes: _classHierarchyNodes, | 993 classHierarchyNodes: _classHierarchyNodes, |
983 classSets: _classSets); | 994 classSets: _classSets); |
984 } | 995 } |
985 | 996 |
986 @override | 997 @override |
987 void registerClass(ClassEntity cls) { | 998 void registerClass(ClassEntity cls) { |
988 throw new UnimplementedError('KernelResolutionWorldBuilder.registerClass'); | 999 throw new UnimplementedError('KernelResolutionWorldBuilder.registerClass'); |
989 } | 1000 } |
990 } | 1001 } |
OLD | NEW |