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_world_from_dill_test; | 7 library dart2js.kernel.closed_world_from_dill_test; |
8 | 8 |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 import 'dart:io'; | 10 import 'dart:io'; |
11 | 11 |
12 import 'package:async_helper/async_helper.dart'; | 12 import 'package:async_helper/async_helper.dart'; |
13 import 'package:compiler/src/commandline_options.dart'; | 13 import 'package:compiler/src/commandline_options.dart'; |
14 import 'package:compiler/src/common.dart'; | 14 import 'package:compiler/src/common.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/kernel/element_map.dart'; | 18 import 'package:compiler/src/kernel/element_map.dart'; |
20 import 'package:compiler/src/kernel/kernel_strategy.dart'; | 19 import 'package:compiler/src/kernel/kernel_strategy.dart'; |
21 import 'package:compiler/src/resolution/enum_creator.dart'; | 20 import 'package:compiler/src/resolution/enum_creator.dart'; |
22 import 'package:compiler/src/universe/world_builder.dart'; | 21 import 'package:compiler/src/universe/world_builder.dart'; |
23 import 'package:compiler/src/world.dart'; | 22 import 'package:compiler/src/world.dart'; |
24 import 'package:expect/expect.dart'; | 23 import 'package:expect/expect.dart'; |
25 import '../memory_compiler.dart'; | 24 import '../memory_compiler.dart'; |
26 import '../equivalence/check_functions.dart'; | 25 import '../equivalence/check_functions.dart'; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 137 |
139 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution; | 138 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution; |
140 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld(); | 139 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld(); |
141 | 140 |
142 checkBackendUsage(closedWorld1.backendUsage, closedWorld2.backendUsage, | 141 checkBackendUsage(closedWorld1.backendUsage, closedWorld2.backendUsage, |
143 equivalence.defaultStrategy); | 142 equivalence.defaultStrategy); |
144 | 143 |
145 checkResolutionEnqueuers(closedWorld1.backendUsage, closedWorld2.backendUsage, | 144 checkResolutionEnqueuers(closedWorld1.backendUsage, closedWorld2.backendUsage, |
146 enqueuer1, enqueuer2, | 145 enqueuer1, enqueuer2, |
147 elementEquivalence: (a, b) => equivalence.entityEquivalence(a, b), | 146 elementEquivalence: (a, b) => equivalence.entityEquivalence(a, b), |
148 typeEquivalence: (ResolutionDartType a, DartType b) { | 147 typeEquivalence: (DartType a, DartType b) { |
149 return equivalence.typeEquivalence(unalias(a), b); | 148 return equivalence.typeEquivalence(unalias(a), b); |
150 }, | 149 }, |
151 elementFilter: elementFilter, | 150 elementFilter: elementFilter, |
152 verbose: arguments.verbose); | 151 verbose: arguments.verbose); |
153 | 152 |
154 checkClosedWorlds(closedWorld1, closedWorld2, | 153 checkClosedWorlds(closedWorld1, closedWorld2, |
155 strategy: equivalence.defaultStrategy, verbose: arguments.verbose); | 154 strategy: equivalence.defaultStrategy, verbose: arguments.verbose); |
156 | 155 |
157 return ResultKind.success; | 156 return ResultKind.success; |
158 } | 157 } |
OLD | NEW |