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

Side by Side Diff: tests/compiler/dart2js/kernel/closed_world_test.dart

Issue 2800643002: Register deferred load impact through ResolutionEnqueuerListener (Closed)
Patch Set: Created 3 years, 8 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/tool/perf.dart ('k') | no next file » | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 // Tests that the closed world computed from [WorldImpact]s derived from kernel 5 // Tests that the closed world computed from [WorldImpact]s derived from kernel
6 // is equivalent to the original computed from resolution. 6 // is equivalent to the original computed from resolution.
7 library dart2js.kernel.closed_world_test; 7 library dart2js.kernel.closed_world_test;
8 8
9 import 'package:async_helper/async_helper.dart'; 9 import 'package:async_helper/async_helper.dart';
10 import 'package:compiler/src/commandline_options.dart'; 10 import 'package:compiler/src/commandline_options.dart';
11 import 'package:compiler/src/common.dart'; 11 import 'package:compiler/src/common.dart';
12 import 'package:compiler/src/common_elements.dart'; 12 import 'package:compiler/src/common_elements.dart';
13 import 'package:compiler/src/common/backend_api.dart'; 13 import 'package:compiler/src/common/backend_api.dart';
14 import 'package:compiler/src/common/resolution.dart'; 14 import 'package:compiler/src/common/resolution.dart';
15 import 'package:compiler/src/compiler.dart'; 15 import 'package:compiler/src/compiler.dart';
16 import 'package:compiler/src/deferred_load.dart';
16 import 'package:compiler/src/elements/resolution_types.dart'; 17 import 'package:compiler/src/elements/resolution_types.dart';
17 import 'package:compiler/src/elements/elements.dart'; 18 import 'package:compiler/src/elements/elements.dart';
18 import 'package:compiler/src/enqueue.dart'; 19 import 'package:compiler/src/enqueue.dart';
19 import 'package:compiler/src/js_backend/backend.dart'; 20 import 'package:compiler/src/js_backend/backend.dart';
20 import 'package:compiler/src/js_backend/backend_helpers.dart'; 21 import 'package:compiler/src/js_backend/backend_helpers.dart';
21 import 'package:compiler/src/js_backend/backend_impact.dart'; 22 import 'package:compiler/src/js_backend/backend_impact.dart';
22 import 'package:compiler/src/js_backend/backend_usage.dart'; 23 import 'package:compiler/src/js_backend/backend_usage.dart';
23 import 'package:compiler/src/js_backend/custom_elements_analysis.dart'; 24 import 'package:compiler/src/js_backend/custom_elements_analysis.dart';
24 import 'package:compiler/src/js_backend/native_data.dart'; 25 import 'package:compiler/src/js_backend/native_data.dart';
25 import 'package:compiler/src/js_backend/interceptor_data.dart'; 26 import 'package:compiler/src/js_backend/interceptor_data.dart';
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 backend.backendUsageBuilder, 152 backend.backendUsageBuilder,
152 backend.rtiNeedBuilder, 153 backend.rtiNeedBuilder,
153 backend.mirrorsDataBuilder, 154 backend.mirrorsDataBuilder,
154 backend.noSuchMethodRegistry, 155 backend.noSuchMethodRegistry,
155 backend.customElementsResolutionAnalysis, 156 backend.customElementsResolutionAnalysis,
156 backend.lookupMapResolutionAnalysis, 157 backend.lookupMapResolutionAnalysis,
157 backend.mirrorsResolutionAnalysis, 158 backend.mirrorsResolutionAnalysis,
158 new TypeVariableResolutionAnalysis(compiler.elementEnvironment, 159 new TypeVariableResolutionAnalysis(compiler.elementEnvironment,
159 backend.impacts, backend.backendUsageBuilder), 160 backend.impacts, backend.backendUsageBuilder),
160 backend.nativeResolutionEnqueuer, 161 backend.nativeResolutionEnqueuer,
162 compiler.deferredLoadTask,
161 backend.kernelTask); 163 backend.kernelTask);
162 } 164 }
163 165
164 EnqueuerListener createKernelResolutionEnqueuerListener( 166 EnqueuerListener createKernelResolutionEnqueuerListener(CompilerOptions options,
165 CompilerOptions options, KernelWorldBuilder worldBuilder) { 167 DeferredLoadTask deferredLoadTask, KernelWorldBuilder worldBuilder) {
166 ElementEnvironment elementEnvironment = worldBuilder.elementEnvironment; 168 ElementEnvironment elementEnvironment = worldBuilder.elementEnvironment;
167 CommonElements commonElements = worldBuilder.commonElements; 169 CommonElements commonElements = worldBuilder.commonElements;
168 BackendHelpers helpers = 170 BackendHelpers helpers =
169 new BackendHelpers(elementEnvironment, commonElements); 171 new BackendHelpers(elementEnvironment, commonElements);
170 BackendImpacts impacts = new BackendImpacts(options, commonElements, helpers); 172 BackendImpacts impacts = new BackendImpacts(options, commonElements, helpers);
171 173
172 // TODO(johnniwinther): Create Kernel based implementations for these: 174 // TODO(johnniwinther): Create Kernel based implementations for these:
173 NativeBasicData nativeBasicData; 175 NativeBasicData nativeBasicData;
174 RuntimeTypesNeedBuilder rtiNeedBuilder; 176 RuntimeTypesNeedBuilder rtiNeedBuilder;
175 MirrorsDataBuilder mirrorsDataBuilder; 177 MirrorsDataBuilder mirrorsDataBuilder;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 interceptorDataBuilder, 209 interceptorDataBuilder,
208 backendUsageBuilder, 210 backendUsageBuilder,
209 rtiNeedBuilder, 211 rtiNeedBuilder,
210 mirrorsDataBuilder, 212 mirrorsDataBuilder,
211 noSuchMethodRegistry, 213 noSuchMethodRegistry,
212 customElementsResolutionAnalysis, 214 customElementsResolutionAnalysis,
213 lookupMapResolutionAnalysis, 215 lookupMapResolutionAnalysis,
214 mirrorsResolutionAnalysis, 216 mirrorsResolutionAnalysis,
215 new TypeVariableResolutionAnalysis( 217 new TypeVariableResolutionAnalysis(
216 elementEnvironment, impacts, backendUsageBuilder), 218 elementEnvironment, impacts, backendUsageBuilder),
217 nativeResolutionEnqueuer); 219 nativeResolutionEnqueuer,
220 deferredLoadTask);
218 } 221 }
219 222
220 ClosedWorld computeClosedWorld(Compiler compiler, ResolutionEnqueuer enqueuer) { 223 ClosedWorld computeClosedWorld(Compiler compiler, ResolutionEnqueuer enqueuer) {
221 JavaScriptBackend backend = compiler.backend; 224 JavaScriptBackend backend = compiler.backend;
222 225
223 if (compiler.deferredLoadTask.isProgramSplit) {
224 enqueuer.applyImpact(backend.computeDeferredLoadingImpact());
225 }
226 enqueuer.open(const ImpactStrategy(), compiler.mainFunction, 226 enqueuer.open(const ImpactStrategy(), compiler.mainFunction,
227 compiler.libraryLoader.libraries); 227 compiler.libraryLoader.libraries);
228 enqueuer.forEach((work) { 228 enqueuer.forEach((work) {
229 MemberElement element = work.element; 229 MemberElement element = work.element;
230 ResolutionImpact resolutionImpact = build(compiler, element.resolvedAst); 230 ResolutionImpact resolutionImpact = build(compiler, element.resolvedAst);
231 WorldImpact worldImpact = compiler.backend.impactTransformer 231 WorldImpact worldImpact = compiler.backend.impactTransformer
232 .transformResolutionImpact(enqueuer, resolutionImpact); 232 .transformResolutionImpact(enqueuer, resolutionImpact);
233 enqueuer.applyImpact(worldImpact, impactSource: element); 233 enqueuer.applyImpact(worldImpact, impactSource: element);
234 }); 234 });
235 return enqueuer.worldBuilder.closeWorld(compiler.reporter); 235 return enqueuer.worldBuilder.closeWorld(compiler.reporter);
236 } 236 }
OLDNEW
« no previous file with comments | « pkg/compiler/tool/perf.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698