| 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 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 forEachInstantiatedClass(addSubtypes); | 924 forEachInstantiatedClass(addSubtypes); |
| 925 | 925 |
| 926 _classHierarchyNodes.keys.toList().forEach(_ensureClassSet); | 926 _classHierarchyNodes.keys.toList().forEach(_ensureClassSet); |
| 927 | 927 |
| 928 return typesImplementedBySubclasses; | 928 return typesImplementedBySubclasses; |
| 929 } | 929 } |
| 930 } | 930 } |
| 931 | 931 |
| 932 abstract class KernelResolutionWorldBuilderBase | 932 abstract class KernelResolutionWorldBuilderBase |
| 933 extends ResolutionWorldBuilderBase { | 933 extends ResolutionWorldBuilderBase { |
| 934 KernelToElementMapImpl get elementMap; |
| 935 |
| 934 KernelResolutionWorldBuilderBase( | 936 KernelResolutionWorldBuilderBase( |
| 935 ElementEnvironment elementEnvironment, | 937 ElementEnvironment elementEnvironment, |
| 936 CommonElements commonElements, | 938 CommonElements commonElements, |
| 937 ConstantSystem constantSystem, | 939 ConstantSystem constantSystem, |
| 938 NativeBasicData nativeBasicData, | 940 NativeBasicData nativeBasicData, |
| 939 NativeDataBuilder nativeDataBuilder, | 941 NativeDataBuilder nativeDataBuilder, |
| 940 InterceptorDataBuilder interceptorDataBuilder, | 942 InterceptorDataBuilder interceptorDataBuilder, |
| 941 BackendUsageBuilder backendUsageBuilder, | 943 BackendUsageBuilder backendUsageBuilder, |
| 942 SelectorConstraintsStrategy selectorConstraintsStrategy) | 944 SelectorConstraintsStrategy selectorConstraintsStrategy) |
| 943 : super( | 945 : super( |
| 944 elementEnvironment, | 946 elementEnvironment, |
| 945 commonElements, | 947 commonElements, |
| 946 constantSystem, | 948 constantSystem, |
| 947 nativeBasicData, | 949 nativeBasicData, |
| 948 nativeDataBuilder, | 950 nativeDataBuilder, |
| 949 interceptorDataBuilder, | 951 interceptorDataBuilder, |
| 950 backendUsageBuilder, | 952 backendUsageBuilder, |
| 951 selectorConstraintsStrategy); | 953 selectorConstraintsStrategy); |
| 952 | 954 |
| 953 @override | 955 @override |
| 954 ClosedWorld closeWorld() { | 956 ClosedWorld closeWorld() { |
| 955 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses = | 957 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses = |
| 956 populateHierarchyNodes(); | 958 populateHierarchyNodes(); |
| 957 _closed = true; | 959 _closed = true; |
| 958 assert( | 960 assert( |
| 959 _classHierarchyNodes.length == _classSets.length, | 961 _classHierarchyNodes.length == _classSets.length, |
| 960 "ClassHierarchyNode/ClassSet mismatch: " | 962 "ClassHierarchyNode/ClassSet mismatch: " |
| 961 "$_classHierarchyNodes vs $_classSets"); | 963 "$_classHierarchyNodes vs $_classSets"); |
| 962 return _closedWorldCache = new KernelClosedWorld( | 964 return _closedWorldCache = new KernelClosedWorld(elementMap, |
| 965 elementEnvironment: _elementEnvironment, |
| 963 commonElements: _commonElements, | 966 commonElements: _commonElements, |
| 964 nativeData: _nativeDataBuilder.close(), | 967 nativeData: _nativeDataBuilder.close(), |
| 965 interceptorData: _interceptorDataBuilder.close(), | 968 interceptorData: _interceptorDataBuilder.close(), |
| 966 backendUsage: _backendUsageBuilder.close(), | 969 backendUsage: _backendUsageBuilder.close(), |
| 967 constantSystem: _constantSystem, | 970 constantSystem: _constantSystem, |
| 968 resolutionWorldBuilder: this, | 971 resolutionWorldBuilder: this, |
| 969 functionSet: _allFunctions.close(), | 972 functionSet: _allFunctions.close(), |
| 970 allTypedefs: _allTypedefs, | 973 allTypedefs: _allTypedefs, |
| 971 mixinUses: _mixinUses, | 974 mixinUses: _mixinUses, |
| 972 typesImplementedBySubclasses: typesImplementedBySubclasses, | 975 typesImplementedBySubclasses: typesImplementedBySubclasses, |
| 973 classHierarchyNodes: _classHierarchyNodes, | 976 classHierarchyNodes: _classHierarchyNodes, |
| 974 classSets: _classSets); | 977 classSets: _classSets); |
| 975 } | 978 } |
| 976 | 979 |
| 977 @override | 980 @override |
| 978 void registerClass(ClassEntity cls) { | 981 void registerClass(ClassEntity cls) { |
| 979 throw new UnimplementedError('KernelResolutionWorldBuilder.registerClass'); | 982 throw new UnimplementedError('KernelResolutionWorldBuilder.registerClass'); |
| 980 } | 983 } |
| 981 } | 984 } |
| OLD | NEW |