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

Unified Diff: compiler/java/com/google/dart/compiler/DartCompiler.java

Issue 8289008: Disambiguate non-incremental mode from optimized mode in dartc (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Renamed some variables for readability" Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/DartCompiler.java
diff --git a/compiler/java/com/google/dart/compiler/DartCompiler.java b/compiler/java/com/google/dart/compiler/DartCompiler.java
index 170d4298794c499468189e0b605f309663d96531..e860694aaf961e36c05236ae59a13f9a269e8df0 100644
--- a/compiler/java/com/google/dart/compiler/DartCompiler.java
+++ b/compiler/java/com/google/dart/compiler/DartCompiler.java
@@ -81,6 +81,7 @@ public class DartCompiler {
private final boolean collectComments;
private CoreTypeProvider typeProvider;
private final boolean incremental;
+ private final boolean usePrecompiledDartLibs;
private final List<DartCompilationPhase> phases;
private final List<Backend> backends;
private final LibrarySource coreLibrarySource;
@@ -107,8 +108,10 @@ public class DartCompiler {
if (config.shouldOptimize()) {
// Optimizing turns off incremental compilation.
incremental = false;
+ usePrecompiledDartLibs = false;
} else {
incremental = config.incremental();
+ usePrecompiledDartLibs = true;
}
}
@@ -193,7 +196,8 @@ public class DartCompiler {
boolean libIsDartUri = SystemLibraryManager.isDartUri(libSrc.getUri());
LibraryUnit apiLib = new LibraryUnit(libSrc);
LibraryNode selfSourcePath = lib.getSelfSourcePath();
- boolean persist = !incremental || !apiLib.loadApi(context, context);
+ boolean shouldLoadApi = incremental || (libIsDartUri && usePrecompiledDartLibs);
+ boolean apiOutOfDate = !(shouldLoadApi && apiLib.loadApi(context, context));
codefu 2011/10/14 20:25:12 Groks much better!
// Parse each compilation unit and update the API to reflect its contents.
for (LibraryNode libNode : lib.getSourcePaths()) {
@@ -214,7 +218,7 @@ public class DartCompiler {
lib.setSelfDartUnit(unit);
}
lib.putUnit(unit);
- persist = true;
+ apiOutOfDate = true;
}
} else {
if (libNode == selfSourcePath) {
@@ -225,7 +229,7 @@ public class DartCompiler {
}
// Persist the api file.
- if (persist) {
+ if (apiOutOfDate) {
context.setFilesHaveChanged();
if (!checkOnly) {
lib.saveApi(context);
@@ -620,8 +624,6 @@ public class DartCompiler {
// The two following for loops can be parallelized.
for (LibraryUnit lib : libraries.values()) {
boolean persist = false;
- boolean isAppLibUnit = (lib == context.getAppLibraryUnit());
- DartUnit libSelfUnit = lib.getSelfDartUnit();
// Compile all the units in this library.
for (DartUnit unit : lib.getUnits()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698