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 |
11 import 'package:async_helper/async_helper.dart'; | 11 import 'package:async_helper/async_helper.dart'; |
12 import 'package:compiler/src/commandline_options.dart'; | 12 import 'package:compiler/src/commandline_options.dart'; |
13 import 'package:compiler/src/common.dart'; | 13 import 'package:compiler/src/common.dart'; |
14 import 'package:compiler/src/common_elements.dart'; | 14 import 'package:compiler/src/common_elements.dart'; |
15 import 'package:compiler/src/compiler.dart'; | 15 import 'package:compiler/src/compiler.dart'; |
16 import 'package:compiler/src/elements/resolution_types.dart'; | |
17 import 'package:compiler/src/elements/types.dart'; | 16 import 'package:compiler/src/elements/types.dart'; |
18 import 'package:compiler/src/enqueue.dart'; | 17 import 'package:compiler/src/enqueue.dart'; |
19 import 'package:compiler/src/js_backend/backend_usage.dart'; | 18 import 'package:compiler/src/js_backend/backend_usage.dart'; |
20 import 'package:compiler/src/kernel/element_map_impl.dart'; | 19 import 'package:compiler/src/kernel/element_map_impl.dart'; |
21 import 'package:compiler/src/kernel/kernel_strategy.dart'; | 20 import 'package:compiler/src/kernel/kernel_strategy.dart'; |
22 import 'package:compiler/src/serialization/equivalence.dart'; | 21 import 'package:compiler/src/serialization/equivalence.dart'; |
23 import 'package:compiler/src/universe/world_builder.dart'; | 22 import 'package:compiler/src/universe/world_builder.dart'; |
24 import 'package:compiler/src/util/util.dart'; | 23 import 'package:compiler/src/util/util.dart'; |
25 import 'package:compiler/src/world.dart'; | 24 import 'package:compiler/src/world.dart'; |
26 import 'package:expect/expect.dart'; | 25 import 'package:expect/expect.dart'; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution; | 141 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution; |
143 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld(); | 142 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld(); |
144 BackendUsage backendUsage2 = closedWorld2.backendUsage; | 143 BackendUsage backendUsage2 = closedWorld2.backendUsage; |
145 | 144 |
146 checkNativeClasses(compiler1, compiler2, strategy); | 145 checkNativeClasses(compiler1, compiler2, strategy); |
147 | 146 |
148 checkBackendUsage(backendUsage1, backendUsage2, strategy); | 147 checkBackendUsage(backendUsage1, backendUsage2, strategy); |
149 | 148 |
150 checkResolutionEnqueuers(backendUsage1, backendUsage2, enqueuer1, enqueuer2, | 149 checkResolutionEnqueuers(backendUsage1, backendUsage2, enqueuer1, enqueuer2, |
151 elementEquivalence: (a, b) => equivalence.entityEquivalence(a, b), | 150 elementEquivalence: (a, b) => equivalence.entityEquivalence(a, b), |
152 typeEquivalence: (ResolutionDartType a, DartType b) { | 151 typeEquivalence: (DartType a, DartType b) { |
153 return equivalence.typeEquivalence(unalias(a), b); | 152 return equivalence.typeEquivalence(unalias(a), b); |
154 }, | 153 }, |
155 elementFilter: elementFilter, | 154 elementFilter: elementFilter, |
156 verbose: arguments.verbose); | 155 verbose: arguments.verbose); |
157 | 156 |
158 checkClosedWorlds(closedWorld1, closedWorld2, | 157 checkClosedWorlds(closedWorld1, closedWorld2, |
159 strategy: equivalence.defaultStrategy, verbose: arguments.verbose); | 158 strategy: equivalence.defaultStrategy, verbose: arguments.verbose); |
160 | 159 |
161 return ResultKind.success; | 160 return ResultKind.success; |
162 } | 161 } |
OLD | NEW |