8042997: Make intrinsic some or all check index/range methods
authorroland
Mon, 16 Nov 2015 10:18:18 +0100
changeset 34358 7dfab3d8f8aa
parent 33664 40f4a8a643ae
child 34359 1ed386980b80
8042997: Make intrinsic some or all check index/range methods Summary: Objects.checkIndex() intrinsic Reviewed-by: psandoz, shade
jdk/src/java.base/share/classes/java/util/Objects.java
--- a/jdk/src/java.base/share/classes/java/util/Objects.java	Thu Nov 05 09:08:42 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/Objects.java	Mon Nov 16 10:18:18 2015 +0100
@@ -27,6 +27,7 @@
 
 import java.util.function.BiFunction;
 import java.util.function.Supplier;
+import jdk.internal.HotSpotIntrinsicCandidate;
 
 /**
  * This class consists of {@code static} utility methods for operating
@@ -416,14 +417,14 @@
      * @throws IndexOutOfBoundsException if the {@code index} is out of bounds
      *         and the exception mapping function is {@code null}
      * @since 9
-     */
-    /*
+     *
+     * @implNote
+     * This method is made intrinsic in optimizing compilers to guide
+     * them to perform unsigned comparisons of the index and length
+     * when it is known the length is a non-negative value (such as
+     * that of an array length or from the upper bound of a loop)
+    */
     @HotSpotIntrinsicCandidate
-    This method will be made intrinsic in C2 to guide HotSpot to perform
-    unsigned comparisons of the index and length when it is known the length is
-    a non-negative value (such as that of an array length or from the upper
-    bound of a loop)
-    */
     public static <T extends RuntimeException>
     int checkIndex(int index, int length,
                    BiFunction<Integer, Integer, T> oobe) throws T, IndexOutOfBoundsException {