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
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java b/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java
index a6b2483..8e569fc 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java
@@ -81,7 +81,6 @@
import com.google.devtools.build.skyframe.EvaluationProgressReceiver;
import com.google.devtools.build.skyframe.EvaluationResult;
import com.google.devtools.build.skyframe.InMemoryMemoizingEvaluator;
-import com.google.devtools.build.skyframe.LegacySkyKey;
import com.google.devtools.build.skyframe.RecordingDifferencer;
import com.google.devtools.build.skyframe.SequencedRecordingDifferencer;
import com.google.devtools.build.skyframe.SequentialBuildDriver;
@@ -109,10 +108,8 @@
* The common code that's shared between various builder tests.
*/
public abstract class TimestampBuilderTestCase extends FoundationTestCase {
- protected static final ActionLookupValue.ActionLookupKey ALL_OWNER =
+ protected static final ActionLookupValue.ActionLookupKey ACTION_LOOKUP_KEY =
new SingletonActionLookupKey();
- protected static final SkyKey OWNER_KEY =
- LegacySkyKey.create(SkyFunctions.ACTION_LOOKUP, ALL_OWNER);
protected static final Predicate<Action> ALWAYS_EXECUTE_FILTER = Predicates.alwaysTrue();
protected static final String CYCLE_MSG = "Yarrrr, there be a cycle up in here";
@@ -238,10 +235,10 @@
return new Builder() {
private void setGeneratingActions() {
- if (evaluator.getExistingValue(OWNER_KEY) == null) {
+ if (evaluator.getExistingValue(ACTION_LOOKUP_KEY) == null) {
differencer.inject(
ImmutableMap.of(
- OWNER_KEY,
+ ACTION_LOOKUP_KEY,
new ActionLookupValue(actionKeyContext, ImmutableList.copyOf(actions), false)));
}
}
@@ -342,7 +339,10 @@
PathFragment execPath = PathFragment.create("out").getRelative(name);
Path path = execRoot.getRelative(execPath);
return new Artifact(
- path, Root.asDerivedRoot(execRoot, execRoot.getRelative("out")), execPath, ALL_OWNER);
+ path,
+ Root.asDerivedRoot(execRoot, execRoot.getRelative("out")),
+ execPath,
+ ACTION_LOOKUP_KEY);
}
/**
@@ -497,13 +497,8 @@
private static class SingletonActionLookupKey extends ActionLookupValue.ActionLookupKey {
@Override
- protected SkyKey getSkyKeyInternal() {
- return OWNER_KEY;
- }
-
- @Override
- protected SkyFunctionName getType() {
- throw new UnsupportedOperationException();
+ public SkyFunctionName functionName() {
+ return SkyFunctions.CONFIGURED_TARGET;
}
}