Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(706)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dart2js.dart

Issue 90713003: Dart2js option to dump info about compilation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library dart2js.cmdline; 5 library dart2js.cmdline;
6 6
7 import 'dart:async' 7 import 'dart:async'
8 show Future, EventSink; 8 show Future, EventSink;
9 import 'dart:io' 9 import 'dart:io'
10 show exit, File, FileMode, Platform, RandomAccessFile; 10 show exit, File, FileMode, Platform, RandomAccessFile;
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 (_) => passThrough('--trust-type-annotations')), 266 (_) => passThrough('--trust-type-annotations')),
267 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), 267 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true),
268 new OptionHandler('--package-root=.+|-p.+', setPackageRoot), 268 new OptionHandler('--package-root=.+|-p.+', setPackageRoot),
269 new OptionHandler('--analyze-all', passThrough), 269 new OptionHandler('--analyze-all', passThrough),
270 new OptionHandler('--analyze-only', setAnalyzeOnly), 270 new OptionHandler('--analyze-only', setAnalyzeOnly),
271 new OptionHandler('--analyze-signatures-only', passThrough), 271 new OptionHandler('--analyze-signatures-only', passThrough),
272 new OptionHandler('--disable-native-live-type-analysis', passThrough), 272 new OptionHandler('--disable-native-live-type-analysis', passThrough),
273 new OptionHandler('--categories=.*', setCategories), 273 new OptionHandler('--categories=.*', setCategories),
274 new OptionHandler('--disable-type-inference', passThrough), 274 new OptionHandler('--disable-type-inference', passThrough),
275 new OptionHandler('--terse', passThrough), 275 new OptionHandler('--terse', passThrough),
276 new OptionHandler('--dump-info', passThrough),
276 new OptionHandler('--disallow-unsafe-eval', 277 new OptionHandler('--disallow-unsafe-eval',
277 (_) => hasDisallowUnsafeEval = true), 278 (_) => hasDisallowUnsafeEval = true),
278 new OptionHandler('-D.+=.*', addInEnvironment), 279 new OptionHandler('-D.+=.*', addInEnvironment),
279 280
280 // The following two options must come last. 281 // The following two options must come last.
281 new OptionHandler('-.*', (String argument) { 282 new OptionHandler('-.*', (String argument) {
282 helpAndFail('Error: Unknown option "$argument".'); 283 helpAndFail('Error: Unknown option "$argument".');
283 }), 284 }),
284 new OptionHandler('.*', (String argument) { 285 new OptionHandler('.*', (String argument) {
285 arguments.add(nativeToUriPath(argument)); 286 arguments.add(nativeToUriPath(argument));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 uri = out; 351 uri = out;
351 sourceMapFileName = 352 sourceMapFileName =
352 sourceMapOut.path.substring(sourceMapOut.path.lastIndexOf('/') + 1); 353 sourceMapOut.path.substring(sourceMapOut.path.lastIndexOf('/') + 1);
353 } else if (extension == 'precompiled.js') { 354 } else if (extension == 'precompiled.js') {
354 uri = computePrecompiledUri(); 355 uri = computePrecompiledUri();
355 diagnosticHandler.info( 356 diagnosticHandler.info(
356 "File ($uri) is compatible with header" 357 "File ($uri) is compatible with header"
357 " \"Content-Security-Policy: script-src 'self'\""); 358 " \"Content-Security-Policy: script-src 'self'\"");
358 } else if (extension == 'js.map' || extension == 'dart.map') { 359 } else if (extension == 'js.map' || extension == 'dart.map') {
359 uri = sourceMapOut; 360 uri = sourceMapOut;
361 } else if (extension == 'info.html') {
362 String outName = out.path.substring(out.path.lastIndexOf('/') + 1);
363 uri = out.resolve('${outName}.$extension');
360 } else { 364 } else {
361 fail('Error: Unknown extension: $extension'); 365 fail('Error: Unknown extension: $extension');
362 } 366 }
363 } else { 367 } else {
364 uri = out.resolve('$name.$extension'); 368 uri = out.resolve('$name.$extension');
365 } 369 }
366 370
367 if (uri.scheme != 'file') { 371 if (uri.scheme != 'file') {
368 fail('Error: Unhandled scheme ${uri.scheme} in $uri.'); 372 fail('Error: Unhandled scheme ${uri.scheme} in $uri.');
369 } 373 }
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 --disable-native-live-type-analysis 559 --disable-native-live-type-analysis
556 Disable the optimization that removes unused native types from dart:html 560 Disable the optimization that removes unused native types from dart:html
557 and related libraries. 561 and related libraries.
558 562
559 --categories=<categories> 563 --categories=<categories>
560 A comma separated list of allowed library categories. The default 564 A comma separated list of allowed library categories. The default
561 is "Client". Possible categories can be seen by providing an 565 is "Client". Possible categories can be seen by providing an
562 unsupported category, for example, --categories=help. To enable 566 unsupported category, for example, --categories=help. To enable
563 all categories, use --categories=all. 567 all categories, use --categories=all.
564 568
569 --dump-info
570 Generates an out.info.html file with information about the generated code.
565 '''.trim()); 571 '''.trim());
566 } 572 }
567 573
568 void helpAndExit(bool wantHelp, bool wantVersion, bool verbose) { 574 void helpAndExit(bool wantHelp, bool wantVersion, bool verbose) {
569 if (wantVersion) { 575 if (wantVersion) {
570 var version = (BUILD_ID == null) 576 var version = (BUILD_ID == null)
571 ? '<non-SDK build>' 577 ? '<non-SDK build>'
572 : BUILD_ID; 578 : BUILD_ID;
573 print('Dart-to-JavaScript compiler (dart2js) version: $version'); 579 print('Dart-to-JavaScript compiler (dart2js) version: $version');
574 } 580 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 } 618 }
613 } 619 }
614 620
615 try { 621 try {
616 return compilerMain(arguments).catchError(onError); 622 return compilerMain(arguments).catchError(onError);
617 } catch (exception, trace) { 623 } catch (exception, trace) {
618 onError(exception, trace); 624 onError(exception, trace);
619 return new Future.value(); 625 return new Future.value();
620 } 626 }
621 } 627 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698