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

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

Issue 2935063002: Add ClosedWorld.elementEnvironment and remove Compiler.elementEnvironment (Closed)
Patch Set: Created 3 years, 6 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/ssa/kernel_ast_adapter.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | 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 /// [ResolutionEnqueuerWorldBuilder] based on the [Element] model. 7 /// [ResolutionEnqueuerWorldBuilder] based on the [Element] model.
8 class ElementResolutionWorldBuilder extends ResolutionWorldBuilderBase { 8 class ElementResolutionWorldBuilder extends ResolutionWorldBuilderBase {
9 /// Used for testing the new more precise computation of instantiated types 9 /// Used for testing the new more precise computation of instantiated types
10 /// and classes. 10 /// and classes.
11 static bool useInstantiationMap = false; 11 static bool useInstantiationMap = false;
12 12
13 final Resolution _resolution; 13 final Resolution _resolution;
14 14
15 ElementResolutionWorldBuilder( 15 ElementResolutionWorldBuilder(
16 JavaScriptBackend backend, 16 JavaScriptBackend backend,
17 this._resolution, 17 this._resolution,
18 NativeBasicData nativeBasicData, 18 NativeBasicData nativeBasicData,
19 NativeDataBuilder nativeDataBuilder, 19 NativeDataBuilder nativeDataBuilder,
20 InterceptorDataBuilder interceptorDataBuilder, 20 InterceptorDataBuilder interceptorDataBuilder,
21 BackendUsageBuilder backendUsageBuilder, 21 BackendUsageBuilder backendUsageBuilder,
22 SelectorConstraintsStrategy selectorConstraintsStrategy) 22 SelectorConstraintsStrategy selectorConstraintsStrategy)
23 : super( 23 : super(
24 backend.compiler.elementEnvironment, 24 _resolution.elementEnvironment,
25 _resolution.commonElements, 25 _resolution.commonElements,
26 backend.constantSystem, 26 backend.constantSystem,
27 nativeBasicData, 27 nativeBasicData,
28 nativeDataBuilder, 28 nativeDataBuilder,
29 interceptorDataBuilder, 29 interceptorDataBuilder,
30 backendUsageBuilder, 30 backendUsageBuilder,
31 selectorConstraintsStrategy); 31 selectorConstraintsStrategy);
32 32
33 bool isImplemented(ClassElement cls) { 33 bool isImplemented(ClassElement cls) {
34 return super.isImplemented(cls.declaration); 34 return super.isImplemented(cls.declaration);
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 ClassEntity getSuperClass(ClassElement cls) => cls.superclass; 166 ClassEntity getSuperClass(ClassElement cls) => cls.superclass;
167 167
168 @override 168 @override
169 Iterable<InterfaceType> getSupertypes(ClassElement cls) => cls.allSupertypes; 169 Iterable<InterfaceType> getSupertypes(ClassElement cls) => cls.allSupertypes;
170 170
171 ClosedWorld closeWorld() { 171 ClosedWorld closeWorld() {
172 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses = 172 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses =
173 populateHierarchyNodes(); 173 populateHierarchyNodes();
174 _closed = true; 174 _closed = true;
175 return _closedWorldCache = new ClosedWorldImpl( 175 return _closedWorldCache = new ClosedWorldImpl(
176 elementEnvironment: _elementEnvironment,
176 commonElements: _commonElements, 177 commonElements: _commonElements,
177 constantSystem: _constantSystem, 178 constantSystem: _constantSystem,
178 nativeData: _nativeDataBuilder.close(), 179 nativeData: _nativeDataBuilder.close(),
179 interceptorData: _interceptorDataBuilder.close(), 180 interceptorData: _interceptorDataBuilder.close(),
180 backendUsage: _backendUsageBuilder.close(), 181 backendUsage: _backendUsageBuilder.close(),
181 resolutionWorldBuilder: this, 182 resolutionWorldBuilder: this,
182 implementedClasses: _implementedClasses, 183 implementedClasses: _implementedClasses,
183 functionSet: _allFunctions.close(), 184 functionSet: _allFunctions.close(),
184 allTypedefs: _allTypedefs, 185 allTypedefs: _allTypedefs,
185 mixinUses: _mixinUses, 186 mixinUses: _mixinUses,
186 typesImplementedBySubclasses: typesImplementedBySubclasses, 187 typesImplementedBySubclasses: typesImplementedBySubclasses,
187 classHierarchyNodes: _classHierarchyNodes, 188 classHierarchyNodes: _classHierarchyNodes,
188 classSets: _classSets); 189 classSets: _classSets);
189 } 190 }
190 191
191 @override 192 @override
192 void registerMixinUse( 193 void registerMixinUse(
193 MixinApplicationElement mixinApplication, ClassElement mixin) { 194 MixinApplicationElement mixinApplication, ClassElement mixin) {
194 assert(mixin.isDeclaration); 195 assert(mixin.isDeclaration);
195 super.registerMixinUse(mixinApplication, mixin); 196 super.registerMixinUse(mixinApplication, mixin);
196 } 197 }
197 } 198 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698