diff options
author | 2017-10-10 04:25:12 +0200 | |
---|---|---|
committer | 2017-10-10 11:23:31 +0200 | |
commit | f5c0e96b3f3daa47d0f2bb7e3c1ee45462375a1d (patch) | |
tree | 1c2567a08f4c3aa39fd6d0b3038741cfd31cb343 /src/main/java | |
parent | 1cde8722b930f1c9cf5346f887a0b293bae49f1f (diff) |
Pull clearing of legacy configured target data up to SkyframeExecutor and rename method to better reflect what it is primarily doing.
PiperOrigin-RevId: 171621356
Diffstat (limited to 'src/main/java')
4 files changed, 18 insertions, 15 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java b/src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java index e8649a55ed..5112418254 100644 --- a/src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java +++ b/src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java @@ -228,7 +228,7 @@ public final class BuildTool { // also pick up any nodes that are in the graph from prior builds. This makes the results // not reproducible at the level of a single command. Either tolerate, or wipe the analysis // graph beforehand if this option is specified, or add another option to wipe if desired - // (SkyframeExecutor#dropConfiguredTargets should be sufficient). + // (SkyframeExecutor#handleConfiguredTargetChange should be sufficient). if (request.getBuildOptions().queryExpression != null) { try { doConfiguredTargetQuery(request, configurations); diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java index 406de7850d..6704f9e2b2 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java @@ -629,10 +629,17 @@ public final class SequencedSkyframeExecutor extends SkyframeExecutor { discardAnalysisCache(topLevelTargets, topLevelAspects); } + /** + * In addition to calling the superclass method, deletes all ConfiguredTarget values from the + * Skyframe cache. This is done to save memory (e.g. on a configuration change); since the + * configuration is part of the key, these key/value pairs will be sitting around doing nothing + * until the configuration changes back to the previous value. + * + * <p>The next evaluation will delete all invalid values. + */ @Override - public void dropConfiguredTargets() { - skyframeBuildView.clearInvalidatedConfiguredTargets(); - skyframeBuildView.clearLegacyData(); + public void handleConfiguredTargetChange() { + super.handleConfiguredTargetChange(); memoizingEvaluator.delete( // We delete any value that can hold an action -- all subclasses of ActionLookupValue -- as // well as ActionExecutionValues, since they do not depend on ActionLookupValues. @@ -656,7 +663,7 @@ public final class SequencedSkyframeExecutor extends SkyframeExecutor { * next build should clear the legacy caches. */ private void dropConfiguredTargetsNow(final ExtendedEventHandler eventHandler) { - dropConfiguredTargets(); + handleConfiguredTargetChange(); // Run the invalidator to actually delete the values. try { progressReceiver.ignoreInvalidations = true; diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java index e30ef7356d..7b3874843c 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java @@ -156,7 +156,7 @@ public final class SkyframeBuildView { if ((this.configurations != null && !configurations.equals(this.configurations)) || skyframeAnalysisWasDiscarded) { logger.info("Discarding analysis cache: configurations have changed."); - skyframeExecutor.dropConfiguredTargets(); + skyframeExecutor.handleConfiguredTargetChange(); } skyframeAnalysisWasDiscarded = false; this.configurations = configurations; 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 0891d0602d..d2e3634cca 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 @@ -616,15 +616,11 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { protected abstract BuildDriver getBuildDriver(); - /** - * Deletes all ConfiguredTarget values from the Skyframe cache. This is done to save memory (e.g. - * on a configuration change); since the configuration is part of the key, these key/value pairs - * will be sitting around doing nothing until the configuration changes back to the previous - * value. - * - * <p>The next evaluation will delete all invalid values. - */ - public abstract void dropConfiguredTargets(); + /** Clear any configured target data stored outside Skyframe. */ + public void handleConfiguredTargetChange() { + skyframeBuildView.clearInvalidatedConfiguredTargets(); + skyframeBuildView.clearLegacyData(); + } /** * Removes ConfigurationFragmentValues from the cache. |