| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 // TODO(sigmund): this is here only to compute the input size, | 315 // TODO(sigmund): this is here only to compute the input size, |
| 316 // we should extract the input size from the frontend instead. | 316 // we should extract the input size from the frontend instead. |
| 317 scanReachableFiles(entryUri); | 317 scanReachableFiles(entryUri); |
| 318 | 318 |
| 319 var timer = new Stopwatch()..start(); | 319 var timer = new Stopwatch()..start(); |
| 320 var options = new CompilerOptions( | 320 var options = new CompilerOptions( |
| 321 entryPoint: entryUri, | 321 entryPoint: entryUri, |
| 322 libraryRoot: _libraryRoot, | 322 libraryRoot: _libraryRoot, |
| 323 packagesDiscoveryProvider: findPackages, | 323 packagesDiscoveryProvider: findPackages, |
| 324 platformConfigUri: _platformConfigUri, | 324 platformConfigUri: _platformConfigUri, |
| 325 useKernel: true, | 325 useKernelInSsa: true, |
| 326 verbose: false); // set to true to debug internal timings | 326 verbose: false); // set to true to debug internal timings |
| 327 var inputProvider = new CompilerSourceFileProvider(); | 327 var inputProvider = new CompilerSourceFileProvider(); |
| 328 var diagnosticHandler = new FormattingDiagnosticHandler(inputProvider) | 328 var diagnosticHandler = new FormattingDiagnosticHandler(inputProvider) |
| 329 ..verbose = options.verbose; | 329 ..verbose = options.verbose; |
| 330 var compiler = new MyCompiler(inputProvider, diagnosticHandler, options); | 330 var compiler = new MyCompiler(inputProvider, diagnosticHandler, options); |
| 331 await compiler.run(entryUri); | 331 await compiler.run(entryUri); |
| 332 timer.stop(); | 332 timer.stop(); |
| 333 report('kernel_gen_e2e', timer.elapsedMicroseconds); | 333 report('kernel_gen_e2e', timer.elapsedMicroseconds); |
| 334 } | 334 } |
| 335 | 335 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 print('compilation failed!'); | 378 print('compilation failed!'); |
| 379 exit(1); | 379 exit(1); |
| 380 } | 380 } |
| 381 | 381 |
| 382 backend.onResolutionEnd(); | 382 backend.onResolutionEnd(); |
| 383 closeResolution(mainFunction); | 383 closeResolution(mainFunction); |
| 384 var program = (backend as dynamic).kernelTask.program; | 384 var program = (backend as dynamic).kernelTask.program; |
| 385 print('total libraries: ${program.libraries.length}'); | 385 print('total libraries: ${program.libraries.length}'); |
| 386 }); | 386 }); |
| 387 } | 387 } |
| OLD | NEW |