diff options
author | 2018-01-11 14:02:35 -0800 | |
---|---|---|
committer | 2018-01-11 14:04:37 -0800 | |
commit | 573807d4e9d1b7a8b6956278773dfc53b544093f (patch) | |
tree | ce89c3a760afbb113f78621a2b1ef0cbb9cef5e5 /src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java | |
parent | 42623f59fdd3bfbdfc21490c69f21537fa32011c (diff) |
Convert ActionLookupKey implementations to directly implement SkyKey, removing the layer of indirection of getting SkyKey out of ActionLookupKey, which uses more memory for no reason.
PiperOrigin-RevId: 181658615
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java index f3d47e3763..56599c1ab8 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java @@ -20,7 +20,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.actions.ActionKeyContext; -import com.google.devtools.build.lib.actions.ActionLookupValue; import com.google.devtools.build.lib.analysis.AliasProvider; import com.google.devtools.build.lib.analysis.AspectResolver; import com.google.devtools.build.lib.analysis.CachingAnalysisEnvironment; @@ -408,8 +407,7 @@ public final class AspectFunction implements SkyFunction { throws DuplicateException { ArrayList<ConfiguredAspect> aspectValues = new ArrayList<>(); for (AspectKey aspectKey : aspectKeys) { - SkyKey skyAspectKey = aspectKey.getSkyKey(); - AspectValue aspectValue = (AspectValue) values.get(skyAspectKey); + AspectValue aspectValue = (AspectValue) values.get(aspectKey); ConfiguredAspect configuredAspect = aspectValue.getConfiguredAspect(); aspectValues.add(configuredAspect); } @@ -438,14 +436,13 @@ public final class AspectFunction implements SkyFunction { return; } ImmutableList<AspectKey> baseKeys = key.getBaseKeys(); - SkyKey skyKey = key.getSkyKey(); - result.put(key.getAspectDescriptor(), skyKey); + result.put(key.getAspectDescriptor(), key); for (AspectKey baseKey : baseKeys) { buildSkyKeys(baseKey, result, aspectPathBuilder); } // Post-order list of aspect SkyKeys gives the order of propagating aspects: // the aspect comes after all aspects it transitively sees. - aspectPathBuilder.add(skyKey); + aspectPathBuilder.add(key); } private SkyValue createAliasAspect( @@ -462,7 +459,7 @@ public final class AspectFunction implements SkyFunction { // the real configured target. Label aliasLabel = aliasChain.size() > 1 ? aliasChain.get(1) : configuredTarget.getLabel(); - SkyKey depKey = ActionLookupValue.key(originalKey.withLabel(aliasLabel)); + SkyKey depKey = originalKey.withLabel(aliasLabel); // Compute the AspectValue of the target the alias refers to (which can itself be either an // alias or a real target) |