| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 backend.impacts, | 134 backend.impacts, |
| 135 backend.backendClasses, | 135 backend.backendClasses, |
| 136 backend.nativeBaseData, | 136 backend.nativeBaseData, |
| 137 backend.interceptorDataBuilder, | 137 backend.interceptorDataBuilder, |
| 138 backend.backendUsageBuilder, | 138 backend.backendUsageBuilder, |
| 139 backend.rtiNeedBuilder, | 139 backend.rtiNeedBuilder, |
| 140 backend.mirrorsDataBuilder, | 140 backend.mirrorsDataBuilder, |
| 141 backend.noSuchMethodRegistry, | 141 backend.noSuchMethodRegistry, |
| 142 backend.customElementsResolutionAnalysis, | 142 backend.customElementsResolutionAnalysis, |
| 143 backend.lookupMapResolutionAnalysis, | 143 backend.lookupMapResolutionAnalysis, |
| 144 backend.mirrorsAnalysis, | 144 backend.mirrorsResolutionAnalysis, |
| 145 new TypeVariableResolutionAnalysis(compiler.elementEnvironment, | 145 new TypeVariableResolutionAnalysis(compiler.elementEnvironment, |
| 146 backend.impacts, backend.backendUsageBuilder), | 146 backend.impacts, backend.backendUsageBuilder), |
| 147 backend.nativeResolutionEnqueuer); | 147 backend.nativeResolutionEnqueuer); |
| 148 } | 148 } |
| 149 | 149 |
| 150 ClosedWorld computeClosedWorld(Compiler compiler, ResolutionEnqueuer enqueuer) { | 150 ClosedWorld computeClosedWorld(Compiler compiler, ResolutionEnqueuer enqueuer) { |
| 151 JavaScriptBackend backend = compiler.backend; | 151 JavaScriptBackend backend = compiler.backend; |
| 152 | 152 |
| 153 if (compiler.deferredLoadTask.isProgramSplit) { | 153 if (compiler.deferredLoadTask.isProgramSplit) { |
| 154 enqueuer.applyImpact(backend.computeDeferredLoadingImpact()); | 154 enqueuer.applyImpact(backend.computeDeferredLoadingImpact()); |
| 155 } | 155 } |
| 156 enqueuer.open(const ImpactStrategy(), compiler.mainFunction, | 156 enqueuer.open(const ImpactStrategy(), compiler.mainFunction, |
| 157 compiler.libraryLoader.libraries); | 157 compiler.libraryLoader.libraries); |
| 158 enqueuer.forEach((work) { | 158 enqueuer.forEach((work) { |
| 159 MemberElement element = work.element; | 159 MemberElement element = work.element; |
| 160 ResolutionImpact resolutionImpact = build(compiler, element.resolvedAst); | 160 ResolutionImpact resolutionImpact = build(compiler, element.resolvedAst); |
| 161 WorldImpact worldImpact = compiler.backend.impactTransformer | 161 WorldImpact worldImpact = compiler.backend.impactTransformer |
| 162 .transformResolutionImpact(enqueuer, resolutionImpact); | 162 .transformResolutionImpact(enqueuer, resolutionImpact); |
| 163 enqueuer.applyImpact(worldImpact, impactSource: element); | 163 enqueuer.applyImpact(worldImpact, impactSource: element); |
| 164 }); | 164 }); |
| 165 return enqueuer.worldBuilder.closeWorld(compiler.reporter); | 165 return enqueuer.worldBuilder.closeWorld(compiler.reporter); |
| 166 } | 166 } |
| OLD | NEW |