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

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

Issue 2693163002: Split backend implementation of EnqueuerListener (Closed)
Patch Set: Updated cf. comments Created 3 years, 10 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) 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';
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 compiler.resolutionWorldBuilder.closeWorld(compiler.reporter); 83 compiler.resolutionWorldBuilder.closeWorld(compiler.reporter);
84 84
85 JavaScriptBackend backend = compiler.backend; 85 JavaScriptBackend backend = compiler.backend;
86 // Create a new resolution enqueuer and feed it with the [WorldImpact]s 86 // Create a new resolution enqueuer and feed it with the [WorldImpact]s
87 // computed from kernel through the [build] in `kernel_impact.dart`. 87 // computed from kernel through the [build] in `kernel_impact.dart`.
88 ResolutionEnqueuer enqueuer = new ResolutionEnqueuer( 88 ResolutionEnqueuer enqueuer = new ResolutionEnqueuer(
89 compiler.enqueuer, 89 compiler.enqueuer,
90 compiler.options, 90 compiler.options,
91 compiler.reporter, 91 compiler.reporter,
92 const TreeShakingEnqueuerStrategy(), 92 const TreeShakingEnqueuerStrategy(),
93 backend, 93 backend.resolutionEnqueuerListener,
94 backend.nativeResolutionEnqueuer(), 94 backend.nativeResolutionEnqueuer(),
95 new ResolutionWorldBuilderImpl( 95 new ResolutionWorldBuilderImpl(
96 compiler.backend, compiler.resolution, const OpenWorldStrategy()), 96 compiler.backend, compiler.resolution, const OpenWorldStrategy()),
97 new ResolutionWorkItemBuilder(compiler.resolution), 97 new ResolutionWorkItemBuilder(compiler.resolution),
98 'enqueuer from kernel'); 98 'enqueuer from kernel');
99 ClosedWorld closedWorld = computeClosedWorld(compiler, enqueuer); 99 ClosedWorld closedWorld = computeClosedWorld(compiler, enqueuer);
100 100
101 checkResolutionEnqueuers(compiler.backend, compiler.backend, 101 checkResolutionEnqueuers(compiler.backend.backendUsage,
102 compiler.enqueuer.resolution, enqueuer, 102 compiler.backend.backendUsage, compiler.enqueuer.resolution, enqueuer,
103 typeEquivalence: (ResolutionDartType a, ResolutionDartType b) { 103 typeEquivalence: (ResolutionDartType a, ResolutionDartType b) {
104 return areTypesEquivalent(unalias(a), unalias(b)); 104 return areTypesEquivalent(unalias(a), unalias(b));
105 }, elementFilter: (Element element) { 105 }, elementFilter: (Element element) {
106 if (element is ConstructorElement && element.isRedirectingFactory) { 106 if (element is ConstructorElement && element.isRedirectingFactory) {
107 // Redirecting factory constructors are skipped in kernel. 107 // Redirecting factory constructors are skipped in kernel.
108 return false; 108 return false;
109 } 109 }
110 if (element is ClassElement) { 110 if (element is ClassElement) {
111 for (ConstructorElement constructor in element.constructors) { 111 for (ConstructorElement constructor in element.constructors) {
112 if (!constructor.isRedirectingFactory) { 112 if (!constructor.isRedirectingFactory) {
(...skipping 29 matching lines...) Expand all
142 backend.computeMainImpact(compiler.mainFunction, forResolution: true)); 142 backend.computeMainImpact(compiler.mainFunction, forResolution: true));
143 enqueuer.forEach((work) { 143 enqueuer.forEach((work) {
144 AstElement element = work.element; 144 AstElement element = work.element;
145 ResolutionImpact resolutionImpact = build(compiler, element.resolvedAst); 145 ResolutionImpact resolutionImpact = build(compiler, element.resolvedAst);
146 WorldImpact worldImpact = compiler.backend.impactTransformer 146 WorldImpact worldImpact = compiler.backend.impactTransformer
147 .transformResolutionImpact(enqueuer, resolutionImpact); 147 .transformResolutionImpact(enqueuer, resolutionImpact);
148 enqueuer.applyImpact(worldImpact, impactSource: element); 148 enqueuer.applyImpact(worldImpact, impactSource: element);
149 }); 149 });
150 return enqueuer.worldBuilder.closeWorld(compiler.reporter); 150 return enqueuer.worldBuilder.closeWorld(compiler.reporter);
151 } 151 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/world.dart ('k') | tests/compiler/dart2js/serialization/model_test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698