diff options
author | 2017-05-03 21:38:28 +0200 | |
---|---|---|
committer | 2017-05-04 13:13:32 +0200 | |
commit | bfdad902c89b101fd39a9795ea493ca5e0531052 (patch) | |
tree | 5512dabeb8dce04ff66d647dfab5b76752c9e775 /src/main/java/com/google/devtools/build/lib/rules | |
parent | c5672f8edb1cb9fb7806024706d776901d7d434e (diff) |
Make SkyKey an interface, and start the migration of not creating SkyKey wrapper objects: for OwnedArtifacts, which are the most numerous during builds, and for Labels for TransitiveTraversalValues, which are the most numerous during queries.
PiperOrigin-RevId: 154989520
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
6 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/BUILD b/src/main/java/com/google/devtools/build/lib/rules/cpp/BUILD index 197ade48e1..15011dc109 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/BUILD +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/BUILD @@ -26,6 +26,7 @@ java_library( "//src/main/java/com/google/devtools/build/lib/actions", "//src/main/java/com/google/devtools/build/lib/rules/apple", "//src/main/java/com/google/devtools/build/skyframe", + "//src/main/java/com/google/devtools/build/skyframe:skyframe-objects", "//src/main/java/com/google/devtools/common/options", "//src/main/protobuf:crosstool_config_java_proto", "//src/main/protobuf:extra_actions_base_java_proto", diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupportValue.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupportValue.java index eb03db6a3f..90ee9326b7 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupportValue.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupportValue.java @@ -17,10 +17,10 @@ import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.LipoMode; +import com.google.devtools.build.skyframe.LegacySkyKey; import com.google.devtools.build.skyframe.SkyFunctionName; import com.google.devtools.build.skyframe.SkyKey; import com.google.devtools.build.skyframe.SkyValue; - import java.util.Objects; /** @@ -96,6 +96,6 @@ public class FdoSupportValue implements SkyValue { } public static SkyKey key(LipoMode lipoMode, Path fdoZip, PathFragment fdoInstrument) { - return SkyKey.create(SKYFUNCTION, new Key(lipoMode, fdoZip, fdoInstrument)); + return LegacySkyKey.create(SKYFUNCTION, new Key(lipoMode, fdoZip, fdoInstrument)); } } diff --git a/src/main/java/com/google/devtools/build/lib/rules/genquery/BUILD b/src/main/java/com/google/devtools/build/lib/rules/genquery/BUILD index 959cf58a75..f59b4ee139 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/genquery/BUILD +++ b/src/main/java/com/google/devtools/build/lib/rules/genquery/BUILD @@ -21,6 +21,7 @@ java_library( "//src/main/java/com/google/devtools/build/lib/query2:query-engine", "//src/main/java/com/google/devtools/build/lib/query2:query-output", "//src/main/java/com/google/devtools/build/skyframe", + "//src/main/java/com/google/devtools/build/skyframe:skyframe-objects", "//src/main/java/com/google/devtools/common/options", "//third_party:guava", "//third_party:jsr305", diff --git a/src/main/java/com/google/devtools/build/lib/rules/genquery/GenQuery.java b/src/main/java/com/google/devtools/build/lib/rules/genquery/GenQuery.java index a53c57ccdd..d044aafed3 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/genquery/GenQuery.java +++ b/src/main/java/com/google/devtools/build/lib/rules/genquery/GenQuery.java @@ -73,6 +73,7 @@ import com.google.devtools.build.lib.util.Fingerprint; import com.google.devtools.build.lib.util.Pair; import com.google.devtools.build.lib.util.Preconditions; import com.google.devtools.build.lib.vfs.PathFragment; +import com.google.devtools.build.skyframe.LegacySkyKey; import com.google.devtools.build.skyframe.SkyFunction; import com.google.devtools.build.skyframe.SkyKey; import com.google.devtools.build.skyframe.ValueOrException; @@ -96,7 +97,7 @@ public class GenQuery implements RuleConfiguredTargetFactory { private static final QueryEnvironmentFactory QUERY_ENVIRONMENT_FACTORY = new QueryEnvironmentFactory(); public static final Precomputed<ImmutableList<OutputFormatter>> QUERY_OUTPUT_FORMATTERS = - new Precomputed<>(SkyKey.create(SkyFunctions.PRECOMPUTED, "query_output_formatters")); + new Precomputed<>(LegacySkyKey.create(SkyFunctions.PRECOMPUTED, "query_output_formatters")); @Override @Nullable diff --git a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java index 1cafeb7e08..f95329ef5c 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java @@ -32,6 +32,7 @@ import com.google.devtools.build.lib.util.Fingerprint; import com.google.devtools.build.lib.vfs.FileSystemUtils; import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; +import com.google.devtools.build.skyframe.LegacySkyKey; import com.google.devtools.build.skyframe.SkyFunction; import com.google.devtools.build.skyframe.SkyFunctionException; import com.google.devtools.build.skyframe.SkyFunctionException.Transience; @@ -53,7 +54,7 @@ import javax.annotation.Nullable; */ public final class RepositoryDelegatorFunction implements SkyFunction { public static final Precomputed<Map<RepositoryName, PathFragment>> REPOSITORY_OVERRIDES = - new Precomputed<>(SkyKey.create(SkyFunctions.PRECOMPUTED, "repository_overrides")); + new Precomputed<>(LegacySkyKey.create(SkyFunctions.PRECOMPUTED, "repository_overrides")); // The marker file version is inject in the rule key digest so the rule key is always different // when we decide to update the format. diff --git a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDirectoryValue.java b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDirectoryValue.java index 4d073d5b1c..6e21ad5b70 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDirectoryValue.java +++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDirectoryValue.java @@ -20,6 +20,7 @@ import com.google.devtools.build.lib.cmdline.RepositoryName; import com.google.devtools.build.lib.skyframe.DirectoryListingValue; import com.google.devtools.build.lib.skyframe.SkyFunctions; import com.google.devtools.build.lib.vfs.Path; +import com.google.devtools.build.skyframe.LegacySkyKey; import com.google.devtools.build.skyframe.SkyKey; import com.google.devtools.build.skyframe.SkyValue; import java.util.Arrays; @@ -124,7 +125,7 @@ public abstract class RepositoryDirectoryValue implements SkyValue { /** Creates a key from the given repository name. */ public static SkyKey key(RepositoryName repository) { - return SkyKey.create(SkyFunctions.REPOSITORY_DIRECTORY, repository); + return LegacySkyKey.create(SkyFunctions.REPOSITORY_DIRECTORY, repository); } public static Builder builder() { |