OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 /// An entrypoint used to run portions of dart2js and measure its performance. | 5 /// An entrypoint used to run portions of dart2js and measure its performance. |
6 library compiler.tool.perf; | 6 library compiler.tool.perf; |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 supportSerialization: serialization.supportSerialization); | 354 supportSerialization: serialization.supportSerialization); |
355 | 355 |
356 phase = Compiler.PHASE_RESOLVING; | 356 phase = Compiler.PHASE_RESOLVING; |
357 resolutionEnqueuer.applyImpact(mainImpact); | 357 resolutionEnqueuer.applyImpact(mainImpact); |
358 // Note: we enqueue everything in the program so we measure generating | 358 // Note: we enqueue everything in the program so we measure generating |
359 // kernel for the entire code, not just what's reachable from main. | 359 // kernel for the entire code, not just what's reachable from main. |
360 libraryLoader.libraries.forEach((LibraryEntity library) { | 360 libraryLoader.libraries.forEach((LibraryEntity library) { |
361 resolutionEnqueuer.applyImpact(computeImpactForLibrary(library)); | 361 resolutionEnqueuer.applyImpact(computeImpactForLibrary(library)); |
362 }); | 362 }); |
363 | 363 |
364 if (commonElements.mirrorsLibrary != null) { | 364 if (frontendStrategy.commonElements.mirrorsLibrary != null) { |
365 resolveLibraryMetadata(); | 365 resolveLibraryMetadata(); |
366 } | 366 } |
367 reporter.log('Resolving...'); | 367 reporter.log('Resolving...'); |
368 processQueue(resolutionEnqueuer, mainFunction, libraryLoader.libraries); | 368 processQueue(resolutionEnqueuer, mainFunction, libraryLoader.libraries); |
369 resolutionEnqueuer.logSummary(reporter.log); | 369 resolutionEnqueuer.logSummary(reporter.log); |
370 | 370 |
371 (reporter as CompilerDiagnosticReporter) | 371 (reporter as CompilerDiagnosticReporter) |
372 .reportSuppressedMessagesSummary(); | 372 .reportSuppressedMessagesSummary(); |
373 | 373 |
374 if (compilationFailed) { | 374 if (compilationFailed) { |
375 // TODO(sigmund): more diagnostics? | 375 // TODO(sigmund): more diagnostics? |
376 print('compilation failed!'); | 376 print('compilation failed!'); |
377 exit(1); | 377 exit(1); |
378 } | 378 } |
379 | 379 |
380 backend.onResolutionEnd(); | 380 backend.onResolutionEnd(); |
381 closeResolution(); | 381 closeResolution(); |
382 var program = (backend as dynamic).kernelTask.program; | 382 var program = (backend as dynamic).kernelTask.program; |
383 print('total libraries: ${program.libraries.length}'); | 383 print('total libraries: ${program.libraries.length}'); |
384 }); | 384 }); |
385 } | 385 } |
OLD | NEW |