8076112: Add @HotSpotIntrinsicCandidate annotation to indicate methods for which Java Runtime has intrinsics

Annotate possibly intrinsified methods with @HotSpotIntrinsicCandidate. Add checks omitted by intrinsics to the library code. Add CheckIntrinsics flags to check consistency of intrinsics.

Reviewed-by: jrose, kvn, thartmann, vlivanov, abuckley, darcy, ascarpino, briangoetz, alanb, aph, dnsimon
This commit is contained in:
Zoltan Majo 2015-07-03 07:23:45 +02:00
parent ea0323cf1a
commit 94d36649af
41 changed files with 667 additions and 30 deletions

View file

@ -42,6 +42,7 @@ import java.util.stream.IntStream;
import java.util.stream.LongStream;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import jdk.internal.HotSpotIntrinsicCandidate;
/**
* This class contains various methods for manipulating arrays (such as
@ -2654,6 +2655,7 @@ public class Arrays {
* @param a2 the other array to be tested for equality
* @return <tt>true</tt> if the two arrays are equal
*/
@HotSpotIntrinsicCandidate
public static boolean equals(char[] a, char[] a2) {
if (a==a2)
return true;
@ -3205,6 +3207,7 @@ public class Arrays {
* an array of class <tt>newType</tt>
* @since 1.6
*/
@HotSpotIntrinsicCandidate
public static <T,U> T[] copyOf(U[] original, int newLength, Class<? extends T[]> newType) {
@SuppressWarnings("unchecked")
T[] copy = ((Object)newType == (Object)Object[].class)
@ -3474,6 +3477,7 @@ public class Arrays {
* an array of class <tt>newType</tt>.
* @since 1.6
*/
@HotSpotIntrinsicCandidate
public static <T,U> T[] copyOfRange(U[] original, int from, int to, Class<? extends T[]> newType) {
int newLength = to - from;
if (newLength < 0)