diff options
author | 2015-10-15 18:41:24 +0000 | |
---|---|---|
committer | 2015-10-16 07:39:30 +0000 | |
commit | 9faad19c24ff526aeb6e30c7df9fcf3583ca1989 (patch) | |
tree | f5bde39ff9ea7a6359e3f0b5ef6bf58c9b1bca31 /src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java | |
parent | 65425810207c9fd6892abfaa95da65e25db5e515 (diff) |
Cache BUILD file AST parsing results instead of preprocessing results (the former uses the latter). This way we parse BUILD files exactly once.
This is part of a series of changes with the net result being that we open, read, and parse each BUILD file exactly once.
--
MOS_MIGRATED_REVID=105528075
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java index a75e6c53a3..0b5c5cb707 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java @@ -83,7 +83,7 @@ import com.google.devtools.build.lib.packages.Package; import com.google.devtools.build.lib.packages.Package.LegacyBuilder; import com.google.devtools.build.lib.packages.PackageFactory; import com.google.devtools.build.lib.packages.Preprocessor; -import com.google.devtools.build.lib.packages.Preprocessor.Result; +import com.google.devtools.build.lib.packages.Preprocessor.AstAfterPreprocessing; import com.google.devtools.build.lib.packages.RuleClassProvider; import com.google.devtools.build.lib.packages.RuleVisibility; import com.google.devtools.build.lib.packages.Target; @@ -181,8 +181,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { // [skyframe-loading] private final Cache<PackageIdentifier, Package.LegacyBuilder> packageFunctionCache = newPkgFunctionCache(); - private final Cache<PackageIdentifier, Preprocessor.Result> preprocessCache = - newPreprocessCache(); + private final Cache<PackageIdentifier, AstAfterPreprocessing> astCache = newAstCache(); private final AtomicInteger numPackagesLoaded = new AtomicInteger(0); @@ -343,7 +342,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { packageManager, showLoadingProgress, packageFunctionCache, - preprocessCache, + astCache, numPackagesLoaded, ruleClassProvider)); map.put(SkyFunctions.PACKAGE_ERROR, new PackageErrorFunction()); @@ -392,7 +391,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { PackageManager packageManager, AtomicBoolean showLoadingProgress, Cache<PackageIdentifier, LegacyBuilder> packageFunctionCache, - Cache<PackageIdentifier, Result> preprocessCache, + Cache<PackageIdentifier, AstAfterPreprocessing> astCache, AtomicInteger numPackagesLoaded, RuleClassProvider ruleClassProvider) { return new PackageFunction( @@ -400,7 +399,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { packageManager, showLoadingProgress, packageFunctionCache, - preprocessCache, + astCache, numPackagesLoaded, null); } @@ -636,7 +635,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { return CacheBuilder.newBuilder().build(); } - protected Cache<PackageIdentifier, Preprocessor.Result> newPreprocessCache() { + protected Cache<PackageIdentifier, Preprocessor.AstAfterPreprocessing> newAstCache() { return CacheBuilder.newBuilder().build(); } @@ -878,7 +877,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { // If the PackageFunction was interrupted, there may be stale entries here. packageFunctionCache.invalidateAll(); - preprocessCache.invalidateAll(); + astCache.invalidateAll(); numPackagesLoaded.set(0); // Reset the stateful SkyframeCycleReporter, which contains cycles from last run. |