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

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

Issue 16114013: Reland "Add --version option to dart2js and add version information (if available) to generated cod… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix formatting. Created 7 years, 6 months 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
« no previous file with comments | « sdk/bin/dart2js.bat ('k') | sdk/lib/_internal/compiler/implementation/dart2js.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of dart2js; 5 part of dart2js;
6 6
7 /** 7 /**
8 * If true, print a warning for each method that was resolved, but not 8 * If true, print a warning for each method that was resolved, but not
9 * compiled. 9 * compiled.
10 */ 10 */
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 static const SourceString CALL_OPERATOR_NAME = const SourceString('call'); 405 static const SourceString CALL_OPERATOR_NAME = const SourceString('call');
406 static const SourceString NO_SUCH_METHOD = const SourceString('noSuchMethod'); 406 static const SourceString NO_SUCH_METHOD = const SourceString('noSuchMethod');
407 static const int NO_SUCH_METHOD_ARG_COUNT = 1; 407 static const int NO_SUCH_METHOD_ARG_COUNT = 1;
408 static const SourceString CREATE_INVOCATION_MIRROR = 408 static const SourceString CREATE_INVOCATION_MIRROR =
409 const SourceString('createInvocationMirror'); 409 const SourceString('createInvocationMirror');
410 static const SourceString INVOKE_ON = const SourceString('_invokeOn'); 410 static const SourceString INVOKE_ON = const SourceString('_invokeOn');
411 static const SourceString RUNTIME_TYPE = const SourceString('runtimeType'); 411 static const SourceString RUNTIME_TYPE = const SourceString('runtimeType');
412 static const SourceString START_ROOT_ISOLATE = 412 static const SourceString START_ROOT_ISOLATE =
413 const SourceString('startRootIsolate'); 413 const SourceString('startRootIsolate');
414 414
415 static const String UNDETERMINED_BUILD_ID =
416 "build number could not be determined";
417
415 final Selector iteratorSelector = 418 final Selector iteratorSelector =
416 new Selector.getter(const SourceString('iterator'), null); 419 new Selector.getter(const SourceString('iterator'), null);
417 final Selector currentSelector = 420 final Selector currentSelector =
418 new Selector.getter(const SourceString('current'), null); 421 new Selector.getter(const SourceString('current'), null);
419 final Selector moveNextSelector = 422 final Selector moveNextSelector =
420 new Selector.call(const SourceString('moveNext'), null, 0); 423 new Selector.call(const SourceString('moveNext'), null, 0);
421 final Selector noSuchMethodSelector = new Selector.call( 424 final Selector noSuchMethodSelector = new Selector.call(
422 Compiler.NO_SUCH_METHOD, null, Compiler.NO_SUCH_METHOD_ARG_COUNT); 425 Compiler.NO_SUCH_METHOD, null, Compiler.NO_SUCH_METHOD_ARG_COUNT);
423 final Selector symbolValidatedConstructorSelector = new Selector.call( 426 final Selector symbolValidatedConstructorSelector = new Selector.call(
424 const SourceString('validated'), null, 1); 427 const SourceString('validated'), null, 1);
(...skipping 27 matching lines...) Expand all
452 bool generateSourceMap: true, 455 bool generateSourceMap: true,
453 bool disallowUnsafeEval: false, 456 bool disallowUnsafeEval: false,
454 this.analyzeAll: false, 457 this.analyzeAll: false,
455 bool analyzeOnly: false, 458 bool analyzeOnly: false,
456 bool analyzeSignaturesOnly: false, 459 bool analyzeSignaturesOnly: false,
457 this.rejectDeprecatedFeatures: false, 460 this.rejectDeprecatedFeatures: false,
458 this.checkDeprecationInSdk: false, 461 this.checkDeprecationInSdk: false,
459 this.preserveComments: false, 462 this.preserveComments: false,
460 this.verbose: false, 463 this.verbose: false,
461 this.sourceMapUri: null, 464 this.sourceMapUri: null,
462 this.buildId: "build number could not be determined", 465 this.buildId: UNDETERMINED_BUILD_ID,
463 outputProvider, 466 outputProvider,
464 List<String> strips: const []}) 467 List<String> strips: const []})
465 : this.analyzeOnly = analyzeOnly || analyzeSignaturesOnly, 468 : this.analyzeOnly = analyzeOnly || analyzeSignaturesOnly,
466 this.analyzeSignaturesOnly = analyzeSignaturesOnly, 469 this.analyzeSignaturesOnly = analyzeSignaturesOnly,
467 this.outputProvider = 470 this.outputProvider = (outputProvider == null)
468 (outputProvider == null) ? NullSink.outputProvider : outputProvider 471 ? NullSink.outputProvider
469 472 : outputProvider {
470 {
471 world = new World(this); 473 world = new World(this);
472 474
473 closureMapping.ClosureNamer closureNamer; 475 closureMapping.ClosureNamer closureNamer;
474 if (emitJavaScript) { 476 if (emitJavaScript) {
475 js_backend.JavaScriptBackend jsBackend = 477 js_backend.JavaScriptBackend jsBackend =
476 new js_backend.JavaScriptBackend(this, generateSourceMap, 478 new js_backend.JavaScriptBackend(this, generateSourceMap,
477 disallowUnsafeEval); 479 disallowUnsafeEval);
478 closureNamer = jsBackend.namer; 480 closureNamer = jsBackend.namer;
479 backend = jsBackend; 481 backend = jsBackend;
480 } else { 482 } else {
(...skipping 20 matching lines...) Expand all
501 enqueuer = new EnqueueTask(this)]; 503 enqueuer = new EnqueueTask(this)];
502 504
503 tasks.addAll(backend.tasks); 505 tasks.addAll(backend.tasks);
504 metadataHandler = new ConstantHandler( 506 metadataHandler = new ConstantHandler(
505 this, backend.constantSystem, isMetadata: true); 507 this, backend.constantSystem, isMetadata: true);
506 } 508 }
507 509
508 Universe get resolverWorld => enqueuer.resolution.universe; 510 Universe get resolverWorld => enqueuer.resolution.universe;
509 Universe get codegenWorld => enqueuer.codegen.universe; 511 Universe get codegenWorld => enqueuer.codegen.universe;
510 512
513 bool get hasBuildId => buildId != UNDETERMINED_BUILD_ID;
514
511 int getNextFreeClassId() => nextFreeClassId++; 515 int getNextFreeClassId() => nextFreeClassId++;
512 516
513 void ensure(bool condition) { 517 void ensure(bool condition) {
514 if (!condition) cancel('failed assertion in leg'); 518 if (!condition) cancel('failed assertion in leg');
515 } 519 }
516 520
517 void unimplemented(String methodName, 521 void unimplemented(String methodName,
518 {Node node, Token token, HInstruction instruction, 522 {Node node, Token token, HInstruction instruction,
519 Element element}) { 523 Element element}) {
520 internalError("$methodName not implemented", 524 internalError("$methodName not implemented",
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 1336
1333 void close() {} 1337 void close() {}
1334 1338
1335 toString() => name; 1339 toString() => name;
1336 1340
1337 /// Convenience method for getting an [api.CompilerOutputProvider]. 1341 /// Convenience method for getting an [api.CompilerOutputProvider].
1338 static NullSink outputProvider(String name, String extension) { 1342 static NullSink outputProvider(String name, String extension) {
1339 return new NullSink('$name.$extension'); 1343 return new NullSink('$name.$extension');
1340 } 1344 }
1341 } 1345 }
OLDNEW
« no previous file with comments | « sdk/bin/dart2js.bat ('k') | sdk/lib/_internal/compiler/implementation/dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698