| OLD | NEW |
| 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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 | 499 |
| 500 // TODO(johnniwinther): Change to map from [Uri] to [LibraryElement]. | 500 // TODO(johnniwinther): Change to map from [Uri] to [LibraryElement]. |
| 501 final Map<String, LibraryElement> libraries = | 501 final Map<String, LibraryElement> libraries = |
| 502 new Map<String, LibraryElement>(); | 502 new Map<String, LibraryElement>(); |
| 503 final Stopwatch totalCompileTime = new Stopwatch(); | 503 final Stopwatch totalCompileTime = new Stopwatch(); |
| 504 int nextFreeClassId = 0; | 504 int nextFreeClassId = 0; |
| 505 World world; | 505 World world; |
| 506 String assembledCode; | 506 String assembledCode; |
| 507 Types types; | 507 Types types; |
| 508 | 508 |
| 509 final CacheStrategy cacheStrategy; |
| 510 |
| 509 /** | 511 /** |
| 510 * Map from token to the first preceeding comment token. | 512 * Map from token to the first preceeding comment token. |
| 511 */ | 513 */ |
| 512 final TokenMap commentMap = new TokenMap(); | 514 final TokenMap commentMap = new TokenMap(); |
| 513 | 515 |
| 514 /** | 516 /** |
| 515 * Records global dependencies, that is, dependencies that don't | 517 * Records global dependencies, that is, dependencies that don't |
| 516 * correspond to a particular element. | 518 * correspond to a particular element. |
| 517 * | 519 * |
| 518 * We should get rid of this and ensure that all dependencies are | 520 * We should get rid of this and ensure that all dependencies are |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 /// `true` if the last diagnostic was filtered, in which case the | 595 /// `true` if the last diagnostic was filtered, in which case the |
| 594 /// accompanying info message should be filtered as well. | 596 /// accompanying info message should be filtered as well. |
| 595 bool lastDiagnosticWasFiltered = false; | 597 bool lastDiagnosticWasFiltered = false; |
| 596 | 598 |
| 597 /// Map containing information about the warnings and hints that have been | 599 /// Map containing information about the warnings and hints that have been |
| 598 /// suppressed for each library. | 600 /// suppressed for each library. |
| 599 Map<Uri, SuppressionInfo> suppressedWarnings = <Uri, SuppressionInfo>{}; | 601 Map<Uri, SuppressionInfo> suppressedWarnings = <Uri, SuppressionInfo>{}; |
| 600 | 602 |
| 601 final bool suppressWarnings; | 603 final bool suppressWarnings; |
| 602 | 604 |
| 605 /// If `true`, some values are cached for reuse in incremental compilation. |
| 606 /// Incremental compilation is basically calling [run] more than once. |
| 607 final bool hasIncrementalSupport; |
| 608 |
| 603 api.CompilerOutputProvider outputProvider; | 609 api.CompilerOutputProvider outputProvider; |
| 604 | 610 |
| 605 bool disableInlining = false; | 611 bool disableInlining = false; |
| 606 | 612 |
| 607 /// True if compilation was aborted with a [CompilerCancelledException]. Only | 613 /// True if compilation was aborted with a [CompilerCancelledException]. Only |
| 608 /// set after Future retuned by [run] has completed. | 614 /// set after Future retuned by [run] has completed. |
| 609 bool compilerWasCancelled = false; | 615 bool compilerWasCancelled = false; |
| 610 | 616 |
| 611 List<Uri> librariesToAnalyzeWhenRun; | 617 List<Uri> librariesToAnalyzeWhenRun; |
| 612 | 618 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 this.preserveComments: false, | 838 this.preserveComments: false, |
| 833 this.verbose: false, | 839 this.verbose: false, |
| 834 this.sourceMapUri: null, | 840 this.sourceMapUri: null, |
| 835 this.outputUri: null, | 841 this.outputUri: null, |
| 836 this.buildId: UNDETERMINED_BUILD_ID, | 842 this.buildId: UNDETERMINED_BUILD_ID, |
| 837 this.terseDiagnostics: false, | 843 this.terseDiagnostics: false, |
| 838 this.dumpInfo: false, | 844 this.dumpInfo: false, |
| 839 this.showPackageWarnings: false, | 845 this.showPackageWarnings: false, |
| 840 this.useContentSecurityPolicy: false, | 846 this.useContentSecurityPolicy: false, |
| 841 this.suppressWarnings: false, | 847 this.suppressWarnings: false, |
| 848 bool hasIncrementalSupport: false, |
| 842 outputProvider, | 849 outputProvider, |
| 843 List<String> strips: const []}) | 850 List<String> strips: const []}) |
| 844 : this.disableTypeInferenceFlag = | 851 : this.disableTypeInferenceFlag = |
| 845 disableTypeInferenceFlag || !emitJavaScript, | 852 disableTypeInferenceFlag || !emitJavaScript, |
| 846 this.analyzeOnly = | 853 this.analyzeOnly = |
| 847 analyzeOnly || analyzeSignaturesOnly || analyzeAllFlag, | 854 analyzeOnly || analyzeSignaturesOnly || analyzeAllFlag, |
| 848 this.analyzeSignaturesOnly = analyzeSignaturesOnly, | 855 this.analyzeSignaturesOnly = analyzeSignaturesOnly, |
| 849 this.analyzeAllFlag = analyzeAllFlag, | 856 this.analyzeAllFlag = analyzeAllFlag, |
| 857 this.hasIncrementalSupport = hasIncrementalSupport, |
| 858 cacheStrategy = new CacheStrategy(hasIncrementalSupport), |
| 850 this.outputProvider = (outputProvider == null) | 859 this.outputProvider = (outputProvider == null) |
| 851 ? NullSink.outputProvider | 860 ? NullSink.outputProvider |
| 852 : outputProvider { | 861 : outputProvider { |
| 853 world = new World(this); | 862 world = new World(this); |
| 854 types = new Types(this); | 863 types = new Types(this); |
| 855 tracer = new Tracer(this.outputProvider); | 864 tracer = new Tracer(this.outputProvider); |
| 856 | 865 |
| 857 closureMapping.ClosureNamer closureNamer; | 866 closureMapping.ClosureNamer closureNamer; |
| 858 if (emitJavaScript) { | 867 if (emitJavaScript) { |
| 859 js_backend.JavaScriptBackend jsBackend = | 868 js_backend.JavaScriptBackend jsBackend = |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1995 static NullSink outputProvider(String name, String extension) { | 2004 static NullSink outputProvider(String name, String extension) { |
| 1996 return new NullSink('$name.$extension'); | 2005 return new NullSink('$name.$extension'); |
| 1997 } | 2006 } |
| 1998 } | 2007 } |
| 1999 | 2008 |
| 2000 /// Information about suppressed warnings and hints for a given library. | 2009 /// Information about suppressed warnings and hints for a given library. |
| 2001 class SuppressionInfo { | 2010 class SuppressionInfo { |
| 2002 int warnings = 0; | 2011 int warnings = 0; |
| 2003 int hints = 0; | 2012 int hints = 0; |
| 2004 } | 2013 } |
| OLD | NEW |