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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 checkResolutionEnqueuers(backendUsage1, backendUsage2, enqueuer1, enqueuer2, | 173 checkResolutionEnqueuers(backendUsage1, backendUsage2, enqueuer1, enqueuer2, |
174 elementEquivalence: equivalence.entityEquivalence, | 174 elementEquivalence: equivalence.entityEquivalence, |
175 typeEquivalence: (ResolutionDartType a, DartType b) { | 175 typeEquivalence: (ResolutionDartType a, DartType b) { |
176 return equivalence.typeEquivalence(unalias(a), b); | 176 return equivalence.typeEquivalence(unalias(a), b); |
177 }, elementFilter: elementFilter, verbose: arguments.verbose); | 177 }, elementFilter: elementFilter, verbose: arguments.verbose); |
178 | 178 |
179 checkClosedWorlds(closedWorld1, closedWorld2, equivalence.entityEquivalence, | 179 checkClosedWorlds(closedWorld1, closedWorld2, equivalence.entityEquivalence, |
180 verbose: arguments.verbose); | 180 verbose: arguments.verbose); |
181 } | 181 } |
182 | 182 |
183 List createKernelResolutionEnqueuerListener( | |
Johnni Winther
2017/05/01 11:56:20
No longer used.
| |
184 CompilerOptions options, | |
185 DiagnosticReporter reporter, | |
186 DeferredLoadTask deferredLoadTask, | |
187 KernelToElementMap elementMap, | |
188 NativeBasicData nativeBasicData) { | |
189 ElementEnvironment elementEnvironment = elementMap.elementEnvironment; | |
190 CommonElements commonElements = elementMap.commonElements; | |
191 BackendImpacts impacts = new BackendImpacts(options, commonElements); | |
192 | |
193 // TODO(johnniwinther): Create Kernel based implementations for these: | |
194 RuntimeTypesNeedBuilder rtiNeedBuilder = new RuntimeTypesNeedBuilderImpl(); | |
195 MirrorsDataBuilder mirrorsDataBuilder = new MirrorsDataBuilderImpl(); | |
196 CustomElementsResolutionAnalysis customElementsResolutionAnalysis = | |
197 new CustomElementsResolutionAnalysisImpl(); | |
198 MirrorsResolutionAnalysis mirrorsResolutionAnalysis = | |
199 new MirrorsResolutionAnalysisImpl(); | |
200 | |
201 LookupMapResolutionAnalysis lookupMapResolutionAnalysis = | |
202 new LookupMapResolutionAnalysis(reporter, elementEnvironment); | |
203 InterceptorDataBuilder interceptorDataBuilder = | |
204 new InterceptorDataBuilderImpl( | |
205 nativeBasicData, elementEnvironment, commonElements); | |
206 BackendUsageBuilder backendUsageBuilder = | |
207 new BackendUsageBuilderImpl(commonElements); | |
208 NoSuchMethodRegistry noSuchMethodRegistry = new NoSuchMethodRegistry( | |
209 commonElements, new KernelNoSuchMethodResolver(elementMap)); | |
210 NativeClassFinder nativeClassFinder = new BaseNativeClassFinder( | |
211 elementEnvironment, commonElements, nativeBasicData); | |
212 NativeResolutionEnqueuer nativeResolutionEnqueuer = | |
213 new NativeResolutionEnqueuer(options, elementEnvironment, commonElements, | |
214 backendUsageBuilder, nativeClassFinder); | |
215 | |
216 ResolutionEnqueuerListener listener = new ResolutionEnqueuerListener( | |
217 options, | |
218 elementEnvironment, | |
219 commonElements, | |
220 impacts, | |
221 nativeBasicData, | |
222 interceptorDataBuilder, | |
223 backendUsageBuilder, | |
224 rtiNeedBuilder, | |
225 mirrorsDataBuilder, | |
226 noSuchMethodRegistry, | |
227 customElementsResolutionAnalysis, | |
228 lookupMapResolutionAnalysis, | |
229 mirrorsResolutionAnalysis, | |
230 new TypeVariableResolutionAnalysis( | |
231 elementEnvironment, impacts, backendUsageBuilder), | |
232 nativeResolutionEnqueuer, | |
233 deferredLoadTask); | |
234 | |
235 ImpactTransformer transformer = new JavaScriptImpactTransformer( | |
236 options, | |
237 elementEnvironment, | |
238 commonElements, | |
239 impacts, | |
240 nativeBasicData, | |
241 nativeResolutionEnqueuer, | |
242 backendUsageBuilder, | |
243 mirrorsDataBuilder, | |
244 customElementsResolutionAnalysis, | |
245 rtiNeedBuilder); | |
246 return [listener, backendUsageBuilder, transformer]; | |
247 } | |
248 | |
249 void checkNativeBasicData(NativeBasicDataImpl data1, NativeBasicDataImpl data2, | 183 void checkNativeBasicData(NativeBasicDataImpl data1, NativeBasicDataImpl data2, |
250 KernelEquivalence equivalence) { | 184 KernelEquivalence equivalence) { |
251 checkMapEquivalence( | 185 checkMapEquivalence( |
252 data1, | 186 data1, |
253 data2, | 187 data2, |
254 'nativeClassTagInfo', | 188 'nativeClassTagInfo', |
255 data1.nativeClassTagInfo, | 189 data1.nativeClassTagInfo, |
256 data2.nativeClassTagInfo, | 190 data2.nativeClassTagInfo, |
257 equivalence.entityEquivalence, | 191 equivalence.entityEquivalence, |
258 (a, b) => a == b); | 192 (a, b) => a == b); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
359 | 293 |
360 MemoryDillLibraryLoaderTask(KernelToElementMap elementMap, | 294 MemoryDillLibraryLoaderTask(KernelToElementMap elementMap, |
361 DiagnosticReporter reporter, Measurer measurer, this.program) | 295 DiagnosticReporter reporter, Measurer measurer, this.program) |
362 : super(elementMap, null, null, reporter, measurer); | 296 : super(elementMap, null, null, reporter, measurer); |
363 | 297 |
364 Future<LoadedLibraries> loadLibrary(Uri resolvedUri, | 298 Future<LoadedLibraries> loadLibrary(Uri resolvedUri, |
365 {bool skipFileWithPartOfTag: false}) async { | 299 {bool skipFileWithPartOfTag: false}) async { |
366 return createLoadedLibraries(program); | 300 return createLoadedLibraries(program); |
367 } | 301 } |
368 } | 302 } |
OLD | NEW |