| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 // Partial test that the closed world computed from [WorldImpact]s derived from | 5 // Partial test that the closed world computed from [WorldImpact]s derived from |
| 6 // kernel is equivalent to the original computed from resolution. | 6 // kernel is equivalent to the original computed from resolution. |
| 7 library dart2js.kernel.closed_world2_test; | 7 library dart2js.kernel.closed_world2_test; |
| 8 | 8 |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 import 'package:compiler/src/js_backend/interceptor_data.dart'; | 30 import 'package:compiler/src/js_backend/interceptor_data.dart'; |
| 31 import 'package:compiler/src/js_backend/lookup_map_analysis.dart'; | 31 import 'package:compiler/src/js_backend/lookup_map_analysis.dart'; |
| 32 import 'package:compiler/src/js_backend/mirrors_analysis.dart' | 32 import 'package:compiler/src/js_backend/mirrors_analysis.dart' |
| 33 hide MirrorsResolutionAnalysisImpl; | 33 hide MirrorsResolutionAnalysisImpl; |
| 34 import 'package:compiler/src/js_backend/mirrors_data.dart'; | 34 import 'package:compiler/src/js_backend/mirrors_data.dart'; |
| 35 import 'package:compiler/src/js_backend/no_such_method_registry.dart'; | 35 import 'package:compiler/src/js_backend/no_such_method_registry.dart'; |
| 36 import 'package:compiler/src/js_backend/resolution_listener.dart'; | 36 import 'package:compiler/src/js_backend/resolution_listener.dart'; |
| 37 import 'package:compiler/src/js_backend/type_variable_handler.dart'; | 37 import 'package:compiler/src/js_backend/type_variable_handler.dart'; |
| 38 import 'package:compiler/src/native/enqueue.dart'; | 38 import 'package:compiler/src/native/enqueue.dart'; |
| 39 import 'package:compiler/src/native/resolver.dart'; | 39 import 'package:compiler/src/native/resolver.dart'; |
| 40 import 'package:compiler/src/kernel/element_map.dart'; | 40 import 'package:compiler/src/kernel/element_map_impl.dart'; |
| 41 import 'package:compiler/src/kernel/kernel_strategy.dart'; | 41 import 'package:compiler/src/kernel/kernel_strategy.dart'; |
| 42 import 'package:compiler/src/library_loader.dart'; | 42 import 'package:compiler/src/library_loader.dart'; |
| 43 import 'package:compiler/src/options.dart'; | 43 import 'package:compiler/src/options.dart'; |
| 44 import 'package:compiler/src/universe/world_builder.dart'; | 44 import 'package:compiler/src/universe/world_builder.dart'; |
| 45 import 'package:compiler/src/util/util.dart'; | 45 import 'package:compiler/src/util/util.dart'; |
| 46 import 'package:compiler/src/world.dart'; | 46 import 'package:compiler/src/world.dart'; |
| 47 import 'package:expect/expect.dart'; | 47 import 'package:expect/expect.dart'; |
| 48 import 'package:kernel/ast.dart' as ir; | 48 import 'package:kernel/ast.dart' as ir; |
| 49 import '../memory_compiler.dart'; | 49 import '../memory_compiler.dart'; |
| 50 import '../serialization/helper.dart'; | 50 import '../serialization/helper.dart'; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 ClosedWorld closedWorld1 = compiler1.resolutionWorldBuilder.closeWorld(); | 146 ClosedWorld closedWorld1 = compiler1.resolutionWorldBuilder.closeWorld(); |
| 147 | 147 |
| 148 Pair<Compiler, Compiler> compilers = | 148 Pair<Compiler, Compiler> compilers = |
| 149 await analyzeOnly(entryPoint, memorySourceFiles, printSteps: true); | 149 await analyzeOnly(entryPoint, memorySourceFiles, printSteps: true); |
| 150 Compiler compiler = compilers.a; | 150 Compiler compiler = compilers.a; |
| 151 compiler.resolutionWorldBuilder.closeWorld(); | 151 compiler.resolutionWorldBuilder.closeWorld(); |
| 152 ElementEnvironment environment1 = compiler.elementEnvironment; | 152 ElementEnvironment environment1 = compiler.elementEnvironment; |
| 153 | 153 |
| 154 Compiler compiler2 = compilers.b; | 154 Compiler compiler2 = compilers.b; |
| 155 KernelFrontEndStrategy frontEndStrategy = compiler2.frontEndStrategy; | 155 KernelFrontEndStrategy frontEndStrategy = compiler2.frontEndStrategy; |
| 156 KernelToElementMap elementMap = frontEndStrategy.elementMap; | 156 KernelToElementMapImpl elementMap = frontEndStrategy.elementMap; |
| 157 Expect.isFalse(compiler2.compilationFailed); | 157 Expect.isFalse(compiler2.compilationFailed); |
| 158 | 158 |
| 159 KernelEquivalence equivalence = new KernelEquivalence(elementMap); | 159 KernelEquivalence equivalence = new KernelEquivalence(elementMap); |
| 160 | 160 |
| 161 ElementEnvironment environment2 = compiler2.elementEnvironment; | 161 ElementEnvironment environment2 = compiler2.elementEnvironment; |
| 162 checkElementEnvironment(environment1, environment2, equivalence); | 162 checkElementEnvironment(environment1, environment2, equivalence); |
| 163 | 163 |
| 164 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution; | 164 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution; |
| 165 BackendUsage backendUsage2 = compiler2.backend.backendUsage; | 165 BackendUsage backendUsage2 = compiler2.backend.backendUsage; |
| 166 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld(); | 166 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld(); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 300 |
| 301 classes2.add(cls2); | 301 classes2.add(cls2); |
| 302 }); | 302 }); |
| 303 env2.forEachClass(lib2, (ClassEntity cls2) { | 303 env2.forEachClass(lib2, (ClassEntity cls2) { |
| 304 Expect.isTrue(classes2.contains(cls2), "Extra class $cls2 in $lib2"); | 304 Expect.isTrue(classes2.contains(cls2), "Extra class $cls2 in $lib2"); |
| 305 }); | 305 }); |
| 306 }); | 306 }); |
| 307 | 307 |
| 308 // TODO(johnniwinther): Test the remaining properties of [ElementEnvironment]. | 308 // TODO(johnniwinther): Test the remaining properties of [ElementEnvironment]. |
| 309 } | 309 } |
| OLD | NEW |