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

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

Issue 340023003: Various caches for incremental compilation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments. Created 6 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
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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = new CacheStrategy();
Johnni Winther 2014/06/19 14:14:04 Use a noop strategy when hasIncrementalSupport is
ahe 2014/06/19 14:33:26 Done. I've haven't actually created a no-op class
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
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
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 this.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,
850 this.outputProvider = (outputProvider == null) 857 this.outputProvider = (outputProvider == null)
851 ? NullSink.outputProvider 858 ? NullSink.outputProvider
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 static NullSink outputProvider(String name, String extension) { 2002 static NullSink outputProvider(String name, String extension) {
1996 return new NullSink('$name.$extension'); 2003 return new NullSink('$name.$extension');
1997 } 2004 }
1998 } 2005 }
1999 2006
2000 /// Information about suppressed warnings and hints for a given library. 2007 /// Information about suppressed warnings and hints for a given library.
2001 class SuppressionInfo { 2008 class SuppressionInfo {
2002 int warnings = 0; 2009 int warnings = 0;
2003 int hints = 0; 2010 int hints = 0;
2004 } 2011 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698