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

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

Issue 2871583002: Pass InterceptorData through ResolutionWorldBuilder and access it through ClosedWorld (Closed)
Patch Set: Created 3 years, 7 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
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 JavaScriptBackend _backend; 13 final JavaScriptBackend _backend;
14 final Resolution _resolution; 14 final Resolution _resolution;
15 15
16 ElementResolutionWorldBuilder( 16 ElementResolutionWorldBuilder(
17 this._backend, 17 this._backend,
18 this._resolution, 18 this._resolution,
19 NativeBasicData nativeBasicData, 19 NativeBasicData nativeBasicData,
20 NativeDataBuilder nativeDataBuilder, 20 NativeDataBuilder nativeDataBuilder,
21 InterceptorDataBuilder interceptorDataBuilder,
21 SelectorConstraintsStrategy selectorConstraintsStrategy) 22 SelectorConstraintsStrategy selectorConstraintsStrategy)
22 : super(_backend.compiler.elementEnvironment, _resolution.commonElements, 23 : super(
23 nativeBasicData, nativeDataBuilder, selectorConstraintsStrategy); 24 _backend.compiler.elementEnvironment,
25 _resolution.commonElements,
26 nativeBasicData,
27 nativeDataBuilder,
28 interceptorDataBuilder,
29 selectorConstraintsStrategy);
24 30
25 bool isImplemented(ClassElement cls) { 31 bool isImplemented(ClassElement cls) {
26 return super.isImplemented(cls.declaration); 32 return super.isImplemented(cls.declaration);
27 } 33 }
28 34
29 void registerTypeInstantiation( 35 void registerTypeInstantiation(
30 InterfaceType type, ClassUsedCallback classUsed, 36 InterfaceType type, ClassUsedCallback classUsed,
31 {ConstructorEntity constructor, 37 {ConstructorEntity constructor,
32 bool byMirrors: false, 38 bool byMirrors: false,
33 bool isRedirection: false}) { 39 bool isRedirection: false}) {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 @override 166 @override
161 Iterable<InterfaceType> getSupertypes(ClassElement cls) => cls.allSupertypes; 167 Iterable<InterfaceType> getSupertypes(ClassElement cls) => cls.allSupertypes;
162 168
163 ClosedWorld closeWorld() { 169 ClosedWorld closeWorld() {
164 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses = 170 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses =
165 populateHierarchyNodes(); 171 populateHierarchyNodes();
166 _closed = true; 172 _closed = true;
167 return _closedWorldCache = new ClosedWorldImpl( 173 return _closedWorldCache = new ClosedWorldImpl(
168 commonElements: _commonElements, 174 commonElements: _commonElements,
169 constantSystem: _backend.constantSystem, 175 constantSystem: _backend.constantSystem,
170 nativeData: _backend.nativeDataBuilder.close(), 176 nativeData: _nativeDataBuilder.close(),
171 interceptorData: _backend.interceptorData, 177 interceptorData: _interceptorDataBuilder.close(),
172 backendUsage: _backend.backendUsage, 178 backendUsage: _backend.backendUsage,
173 resolutionWorldBuilder: this, 179 resolutionWorldBuilder: this,
174 functionSet: _allFunctions.close(), 180 functionSet: _allFunctions.close(),
175 allTypedefs: _allTypedefs, 181 allTypedefs: _allTypedefs,
176 mixinUses: _mixinUses, 182 mixinUses: _mixinUses,
177 typesImplementedBySubclasses: typesImplementedBySubclasses, 183 typesImplementedBySubclasses: typesImplementedBySubclasses,
178 classHierarchyNodes: _classHierarchyNodes, 184 classHierarchyNodes: _classHierarchyNodes,
179 classSets: _classSets); 185 classSets: _classSets);
180 } 186 }
181 187
182 @override 188 @override
183 void registerMixinUse( 189 void registerMixinUse(
184 MixinApplicationElement mixinApplication, ClassElement mixin) { 190 MixinApplicationElement mixinApplication, ClassElement mixin) {
185 assert(mixin.isDeclaration); 191 assert(mixin.isDeclaration);
186 super.registerMixinUse(mixinApplication, mixin); 192 super.registerMixinUse(mixinApplication, mixin);
187 } 193 }
188 } 194 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | pkg/compiler/lib/src/universe/resolution_world_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698