| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 (frontendStrategy.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(frontendStrategy.elementEnvironment, resolutionEnqueuer, |
| 369 mainFunction, libraryLoader.libraries); |
| 369 resolutionEnqueuer.logSummary(reporter.log); | 370 resolutionEnqueuer.logSummary(reporter.log); |
| 370 | 371 |
| 371 (reporter as CompilerDiagnosticReporter) | 372 (reporter as CompilerDiagnosticReporter) |
| 372 .reportSuppressedMessagesSummary(); | 373 .reportSuppressedMessagesSummary(); |
| 373 | 374 |
| 374 if (compilationFailed) { | 375 if (compilationFailed) { |
| 375 // TODO(sigmund): more diagnostics? | 376 // TODO(sigmund): more diagnostics? |
| 376 print('compilation failed!'); | 377 print('compilation failed!'); |
| 377 exit(1); | 378 exit(1); |
| 378 } | 379 } |
| 379 | 380 |
| 380 backend.onResolutionEnd(); | 381 backend.onResolutionEnd(); |
| 381 closeResolution(); | 382 closeResolution(); |
| 382 var program = (backend as dynamic).kernelTask.program; | 383 var program = (backend as dynamic).kernelTask.program; |
| 383 print('total libraries: ${program.libraries.length}'); | 384 print('total libraries: ${program.libraries.length}'); |
| 384 }); | 385 }); |
| 385 } | 386 } |
| OLD | NEW |