Summary
Propose making VectorShape#largestShapeFor public to align with existing Vector API documentation elsewhere that references it.
Problem
Existing Vector API documentation in the Vector class references this method as though it were public, but it is currently package private.
Solution
VectorShape#largestShapeFor will be made public with documentation
Specification
diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShape.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShape.java
index 89e0d38bcb0..e14afa70774 100644
--- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShape.java
+++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShape.java
@@ -208,13 +208,22 @@ static VectorShape ofSwitchKey(int sk) {
}
}
- // non-public support for computing preferred shapes
-
- /*package-private*/
- static VectorShape largestShapeFor(Class<?> etype) {
+ /**
+ * Finds the largest vector shape supported by the current
+ * platform for the element type {@code etype}.
+ *
+ * @param etype the element type
+ * @return the largest vector shape supported by the platform
+ * for {@code etype}
+ * @throws IllegalArgumentException if no such vector shape exists
+ * for the element type or the type is not a valid {@code ETYPE}.
+ */
+ public static VectorShape largestShapeFor(Class<?> etype) {
return VectorShape.forBitSize(getMaxVectorBitSize(etype));
}
+ // non-public support for computing preferred shapes
+
/**
* Finds the vector shape preferred by the current platform
* for all vector element types.
- csr of
-
JDK-8356634 VectorShape#largestShapeFor should have public access
-
- Resolved
-