| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 EnqueuerListener createKernelResolutionEnqueuerListener( | 163 EnqueuerListener createKernelResolutionEnqueuerListener( |
| 164 CompilerOptions options, KernelWorldBuilder worldBuilder) { | 164 CompilerOptions options, KernelWorldBuilder worldBuilder) { |
| 165 ElementEnvironment elementEnvironment = worldBuilder.elementEnvironment; | 165 ElementEnvironment elementEnvironment = worldBuilder.elementEnvironment; |
| 166 CommonElements commonElements = worldBuilder.commonElements; | 166 CommonElements commonElements = worldBuilder.commonElements; |
| 167 BackendHelpers helpers = | 167 BackendHelpers helpers = |
| 168 new BackendHelpers(elementEnvironment, commonElements); | 168 new BackendHelpers(elementEnvironment, commonElements); |
| 169 BackendImpacts impacts = new BackendImpacts(options, commonElements, helpers); | 169 BackendImpacts impacts = new BackendImpacts(options, commonElements, helpers); |
| 170 | 170 |
| 171 // TODO(johnniwinther): Create Kernel based implementations for these: | 171 // TODO(johnniwinther): Create Kernel based implementations for these: |
| 172 NativeBasicData nativeBasicData; | 172 NativeBasicData nativeBasicData; |
| 173 InterceptorDataBuilder interceptorDataBuilder; | |
| 174 BackendUsageBuilder backendUsageBuilder; | |
| 175 RuntimeTypesNeedBuilder rtiNeedBuilder; | 173 RuntimeTypesNeedBuilder rtiNeedBuilder; |
| 176 MirrorsDataBuilder mirrorsDataBuilder; | 174 MirrorsDataBuilder mirrorsDataBuilder; |
| 177 NoSuchMethodRegistry noSuchMethodRegistry; | 175 NoSuchMethodRegistry noSuchMethodRegistry; |
| 178 CustomElementsResolutionAnalysis customElementsResolutionAnalysis; | 176 CustomElementsResolutionAnalysis customElementsResolutionAnalysis; |
| 179 LookupMapResolutionAnalysis lookupMapResolutionAnalysis; | 177 LookupMapResolutionAnalysis lookupMapResolutionAnalysis; |
| 180 MirrorsResolutionAnalysis mirrorsResolutionAnalysis; | 178 MirrorsResolutionAnalysis mirrorsResolutionAnalysis; |
| 181 NativeResolutionEnqueuer nativeResolutionEnqueuer; | 179 NativeResolutionEnqueuer nativeResolutionEnqueuer; |
| 182 | 180 |
| 181 InterceptorDataBuilder interceptorDataBuilder = |
| 182 new InterceptorDataBuilderImpl( |
| 183 nativeBasicData, helpers, elementEnvironment, commonElements); |
| 184 BackendUsageBuilder backendUsageBuilder = |
| 185 new BackendUsageBuilderImpl(commonElements, helpers); |
| 186 |
| 183 return new ResolutionEnqueuerListener( | 187 return new ResolutionEnqueuerListener( |
| 184 options, | 188 options, |
| 185 elementEnvironment, | 189 elementEnvironment, |
| 186 commonElements, | 190 commonElements, |
| 187 helpers, | 191 helpers, |
| 188 impacts, | 192 impacts, |
| 189 new JavaScriptBackendClasses( | 193 new JavaScriptBackendClasses( |
| 190 elementEnvironment, helpers, nativeBasicData), | 194 elementEnvironment, helpers, nativeBasicData), |
| 191 nativeBasicData, | 195 nativeBasicData, |
| 192 interceptorDataBuilder, | 196 interceptorDataBuilder, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 212 compiler.libraryLoader.libraries); | 216 compiler.libraryLoader.libraries); |
| 213 enqueuer.forEach((work) { | 217 enqueuer.forEach((work) { |
| 214 MemberElement element = work.element; | 218 MemberElement element = work.element; |
| 215 ResolutionImpact resolutionImpact = build(compiler, element.resolvedAst); | 219 ResolutionImpact resolutionImpact = build(compiler, element.resolvedAst); |
| 216 WorldImpact worldImpact = compiler.backend.impactTransformer | 220 WorldImpact worldImpact = compiler.backend.impactTransformer |
| 217 .transformResolutionImpact(enqueuer, resolutionImpact); | 221 .transformResolutionImpact(enqueuer, resolutionImpact); |
| 218 enqueuer.applyImpact(worldImpact, impactSource: element); | 222 enqueuer.applyImpact(worldImpact, impactSource: element); |
| 219 }); | 223 }); |
| 220 return enqueuer.worldBuilder.closeWorld(compiler.reporter); | 224 return enqueuer.worldBuilder.closeWorld(compiler.reporter); |
| 221 } | 225 } |
| OLD | NEW |