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'; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 KernelEquivalence equivalence = new KernelEquivalence(elementMap); | 137 KernelEquivalence equivalence = new KernelEquivalence(elementMap); |
138 | 138 |
139 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution; | 139 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution; |
140 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld(); | 140 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld(); |
141 | 141 |
142 checkBackendUsage(closedWorld1.backendUsage, closedWorld2.backendUsage, | 142 checkBackendUsage(closedWorld1.backendUsage, closedWorld2.backendUsage, |
143 equivalence.defaultStrategy); | 143 equivalence.defaultStrategy); |
144 | 144 |
145 checkResolutionEnqueuers(closedWorld1.backendUsage, closedWorld2.backendUsage, | 145 checkResolutionEnqueuers(closedWorld1.backendUsage, closedWorld2.backendUsage, |
146 enqueuer1, enqueuer2, elementEquivalence: equivalence.entityEquivalence, | 146 enqueuer1, enqueuer2, |
| 147 elementEquivalence: (a, b) => equivalence.entityEquivalence(a, b), |
147 typeEquivalence: (ResolutionDartType a, DartType b) { | 148 typeEquivalence: (ResolutionDartType a, DartType b) { |
148 return equivalence.typeEquivalence(unalias(a), b); | 149 return equivalence.typeEquivalence(unalias(a), b); |
149 }, elementFilter: elementFilter, verbose: arguments.verbose); | 150 }, |
| 151 elementFilter: elementFilter, |
| 152 verbose: arguments.verbose); |
150 | 153 |
151 checkClosedWorlds(closedWorld1, closedWorld2, | 154 checkClosedWorlds(closedWorld1, closedWorld2, |
152 strategy: equivalence.defaultStrategy, verbose: arguments.verbose); | 155 strategy: equivalence.defaultStrategy, verbose: arguments.verbose); |
153 | 156 |
154 return ResultKind.success; | 157 return ResultKind.success; |
155 } | 158 } |
OLD | NEW |