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
diff --git a/src/main/java/com/google/devtools/build/skyframe/BUILD b/src/main/java/com/google/devtools/build/skyframe/BUILD
index 51f41b4..55c35f8 100644
--- a/src/main/java/com/google/devtools/build/skyframe/BUILD
+++ b/src/main/java/com/google/devtools/build/skyframe/BUILD
@@ -4,10 +4,33 @@
     default_visibility = ["//src:__subpackages__"],
 )
 
+SKYFRAME_OBJECT_SRCS = [
+    "SkyValue.java",
+    "SkyKey.java",
+    "LegacySkyKey.java",
+    "SkyFunctionName.java",
+]
+
+java_library(
+    name = "skyframe-objects",
+    srcs = SKYFRAME_OBJECT_SRCS,
+    visibility = ["//visibility:public"],
+    deps = [
+        "//src/main/java/com/google/devtools/build/lib:collect",
+        "//src/main/java/com/google/devtools/build/lib:concurrent",
+        "//src/main/java/com/google/devtools/build/lib:preconditions",
+        "//third_party:guava",
+    ],
+)
+
 java_library(
     name = "skyframe",
-    srcs = glob(["**/*.java"]),
+    srcs = glob(
+        ["**/*.java"],
+        exclude = SKYFRAME_OBJECT_SRCS,
+    ),
     deps = [
+        ":skyframe-objects",
         "//src/main/java/com/google/devtools/build/lib:clock",  # keep
         "//src/main/java/com/google/devtools/build/lib:collect",
         "//src/main/java/com/google/devtools/build/lib:concurrent",