| 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 supportSerialization: serialization.supportSerialization); | 375 supportSerialization: serialization.supportSerialization); |
| 376 | 376 |
| 377 phase = Compiler.PHASE_RESOLVING; | 377 phase = Compiler.PHASE_RESOLVING; |
| 378 | 378 |
| 379 // Note: we enqueue everything in the program so we measure generating | 379 // Note: we enqueue everything in the program so we measure generating |
| 380 // kernel for the entire code, not just what's reachable from main. | 380 // kernel for the entire code, not just what's reachable from main. |
| 381 libraryLoader.libraries.forEach((LibraryElement library) { | 381 libraryLoader.libraries.forEach((LibraryElement library) { |
| 382 fullyEnqueueLibrary(library, enqueuer.resolution); | 382 fullyEnqueueLibrary(library, enqueuer.resolution); |
| 383 }); | 383 }); |
| 384 | 384 |
| 385 backend.enqueueHelpers(enqueuer.resolution, globalDependencies); | 385 backend.enqueueHelpers(enqueuer.resolution); |
| 386 resolveLibraryMetadata(); | 386 resolveLibraryMetadata(); |
| 387 reporter.log('Resolving...'); | 387 reporter.log('Resolving...'); |
| 388 processQueue(enqueuer.resolution, mainFunction); | 388 processQueue(enqueuer.resolution, mainFunction); |
| 389 enqueuer.resolution.logSummary(reporter.log); | 389 enqueuer.resolution.logSummary(reporter.log); |
| 390 | 390 |
| 391 (reporter as CompilerDiagnosticReporter) | 391 (reporter as CompilerDiagnosticReporter) |
| 392 .reportSuppressedMessagesSummary(); | 392 .reportSuppressedMessagesSummary(); |
| 393 | 393 |
| 394 if (compilationFailed) { | 394 if (compilationFailed) { |
| 395 // TODO(sigmund): more diagnostics? | 395 // TODO(sigmund): more diagnostics? |
| 396 print("compilation failed!"); | 396 print("compilation failed!"); |
| 397 exit(1); | 397 exit(1); |
| 398 } | 398 } |
| 399 | 399 |
| 400 closeResolution(); | 400 closeResolution(); |
| 401 var program = (backend as dynamic).kernelTask.program; | 401 var program = (backend as dynamic).kernelTask.program; |
| 402 print('total libraries: ${program.libraries.length}'); | 402 print('total libraries: ${program.libraries.length}'); |
| 403 }); | 403 }); |
| 404 } | 404 } |
| OLD | NEW |