| 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/closure.dart'; | 10 import 'package:compiler/src/closure.dart'; |
| 11 import 'package:compiler/src/commandline_options.dart'; | 11 import 'package:compiler/src/commandline_options.dart'; |
| 12 import 'package:compiler/src/common.dart'; | 12 import 'package:compiler/src/common.dart'; |
| 13 import 'package:compiler/src/common_elements.dart'; | 13 import 'package:compiler/src/common_elements.dart'; |
| 14 import 'package:compiler/src/common/backend_api.dart'; | 14 import 'package:compiler/src/common/backend_api.dart'; |
| 15 import 'package:compiler/src/common/resolution.dart'; | 15 import 'package:compiler/src/common/resolution.dart'; |
| 16 import 'package:compiler/src/common/work.dart'; | 16 import 'package:compiler/src/common/work.dart'; |
| 17 import 'package:compiler/src/compiler.dart'; | 17 import 'package:compiler/src/compiler.dart'; |
| 18 import 'package:compiler/src/deferred_load.dart'; | 18 import 'package:compiler/src/deferred_load.dart'; |
| 19 import 'package:compiler/src/elements/resolution_types.dart'; | 19 import 'package:compiler/src/elements/resolution_types.dart'; |
| 20 import 'package:compiler/src/elements/elements.dart'; | 20 import 'package:compiler/src/elements/elements.dart'; |
| 21 import 'package:compiler/src/elements/entities.dart'; | 21 import 'package:compiler/src/elements/entities.dart'; |
| 22 import 'package:compiler/src/elements/types.dart'; | 22 import 'package:compiler/src/elements/types.dart'; |
| 23 import 'package:compiler/src/enqueue.dart'; | 23 import 'package:compiler/src/enqueue.dart'; |
| 24 import 'package:compiler/src/js_backend/backend.dart'; | 24 import 'package:compiler/src/js_backend/backend.dart'; |
| 25 import 'package:compiler/src/js_backend/backend_helpers.dart'; | |
| 26 import 'package:compiler/src/js_backend/backend_impact.dart'; | 25 import 'package:compiler/src/js_backend/backend_impact.dart'; |
| 27 import 'package:compiler/src/js_backend/backend_usage.dart'; | 26 import 'package:compiler/src/js_backend/backend_usage.dart'; |
| 28 import 'package:compiler/src/js_backend/custom_elements_analysis.dart'; | 27 import 'package:compiler/src/js_backend/custom_elements_analysis.dart'; |
| 29 import 'package:compiler/src/js_backend/native_data.dart'; | 28 import 'package:compiler/src/js_backend/native_data.dart'; |
| 30 import 'package:compiler/src/js_backend/impact_transformer.dart'; | 29 import 'package:compiler/src/js_backend/impact_transformer.dart'; |
| 31 import 'package:compiler/src/js_backend/interceptor_data.dart'; | 30 import 'package:compiler/src/js_backend/interceptor_data.dart'; |
| 32 import 'package:compiler/src/js_backend/lookup_map_analysis.dart'; | 31 import 'package:compiler/src/js_backend/lookup_map_analysis.dart'; |
| 33 import 'package:compiler/src/js_backend/mirrors_analysis.dart'; | 32 import 'package:compiler/src/js_backend/mirrors_analysis.dart'; |
| 34 import 'package:compiler/src/js_backend/mirrors_data.dart'; | 33 import 'package:compiler/src/js_backend/mirrors_data.dart'; |
| 35 import 'package:compiler/src/js_backend/no_such_method_registry.dart'; | 34 import 'package:compiler/src/js_backend/no_such_method_registry.dart'; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 verbose: arguments.verbose); | 143 verbose: arguments.verbose); |
| 145 }); | 144 }); |
| 146 } | 145 } |
| 147 | 146 |
| 148 EnqueuerListener createResolutionEnqueuerListener(Compiler compiler) { | 147 EnqueuerListener createResolutionEnqueuerListener(Compiler compiler) { |
| 149 JavaScriptBackend backend = compiler.backend; | 148 JavaScriptBackend backend = compiler.backend; |
| 150 return new ResolutionEnqueuerListener( | 149 return new ResolutionEnqueuerListener( |
| 151 compiler.options, | 150 compiler.options, |
| 152 compiler.elementEnvironment, | 151 compiler.elementEnvironment, |
| 153 compiler.commonElements, | 152 compiler.commonElements, |
| 154 backend.helpers, | |
| 155 backend.impacts, | 153 backend.impacts, |
| 156 backend.backendClasses, | 154 backend.backendClasses, |
| 157 backend.nativeBasicData, | 155 backend.nativeBasicData, |
| 158 backend.interceptorDataBuilder, | 156 backend.interceptorDataBuilder, |
| 159 backend.backendUsageBuilder, | 157 backend.backendUsageBuilder, |
| 160 backend.rtiNeedBuilder, | 158 backend.rtiNeedBuilder, |
| 161 backend.mirrorsDataBuilder, | 159 backend.mirrorsDataBuilder, |
| 162 backend.noSuchMethodRegistry, | 160 backend.noSuchMethodRegistry, |
| 163 backend.customElementsResolutionAnalysis, | 161 backend.customElementsResolutionAnalysis, |
| 164 backend.lookupMapResolutionAnalysis, | 162 backend.lookupMapResolutionAnalysis, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 final MemberElement element; | 196 final MemberElement element; |
| 199 | 197 |
| 200 KernelWorkItem(this._compiler, this._impactTransformer, this.element); | 198 KernelWorkItem(this._compiler, this._impactTransformer, this.element); |
| 201 | 199 |
| 202 @override | 200 @override |
| 203 WorldImpact run() { | 201 WorldImpact run() { |
| 204 ResolutionImpact resolutionImpact = build(_compiler, element.resolvedAst); | 202 ResolutionImpact resolutionImpact = build(_compiler, element.resolvedAst); |
| 205 return _impactTransformer.transformResolutionImpact(resolutionImpact); | 203 return _impactTransformer.transformResolutionImpact(resolutionImpact); |
| 206 } | 204 } |
| 207 } | 205 } |
| OLD | NEW |