OLD | NEW |
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 customElementsResolutionAnalysis, | 214 customElementsResolutionAnalysis, |
215 lookupMapResolutionAnalysis, | 215 lookupMapResolutionAnalysis, |
216 mirrorsResolutionAnalysis, | 216 mirrorsResolutionAnalysis, |
217 new TypeVariableResolutionAnalysis( | 217 new TypeVariableResolutionAnalysis( |
218 elementEnvironment, impacts, backendUsageBuilder), | 218 elementEnvironment, impacts, backendUsageBuilder), |
219 nativeResolutionEnqueuer, | 219 nativeResolutionEnqueuer, |
220 deferredLoadTask); | 220 deferredLoadTask); |
221 } | 221 } |
222 | 222 |
223 ClosedWorld computeClosedWorld(Compiler compiler, ResolutionEnqueuer enqueuer) { | 223 ClosedWorld computeClosedWorld(Compiler compiler, ResolutionEnqueuer enqueuer) { |
224 JavaScriptBackend backend = compiler.backend; | |
225 | |
226 enqueuer.open(const ImpactStrategy(), compiler.mainFunction, | 224 enqueuer.open(const ImpactStrategy(), compiler.mainFunction, |
227 compiler.libraryLoader.libraries); | 225 compiler.libraryLoader.libraries); |
228 enqueuer.forEach((work) { | 226 enqueuer.forEach((work) { |
229 MemberElement element = work.element; | 227 MemberElement element = work.element; |
230 ResolutionImpact resolutionImpact = build(compiler, element.resolvedAst); | 228 ResolutionImpact resolutionImpact = build(compiler, element.resolvedAst); |
231 WorldImpact worldImpact = compiler.backend.impactTransformer | 229 WorldImpact worldImpact = compiler.backend.impactTransformer |
232 .transformResolutionImpact(enqueuer, resolutionImpact); | 230 .transformResolutionImpact(enqueuer, resolutionImpact); |
233 enqueuer.applyImpact(worldImpact, impactSource: element); | 231 enqueuer.applyImpact(worldImpact, impactSource: element); |
234 }); | 232 }); |
235 return enqueuer.worldBuilder.closeWorld(compiler.reporter); | 233 return enqueuer.worldBuilder.closeWorld(compiler.reporter); |
236 } | 234 } |
OLD | NEW |