8138732: Rename @HotSpotIntrinsicCandidate to @IntrinsicCandidate and move it to the jdk.internal.vm.annotation package

Reviewed-by: dholmes, alanb, psandoz, kvn, egahlin
This commit is contained in:
Philippe Marschall 2020-09-30 20:05:07 +00:00 committed by Vladimir Kozlov
parent 4b16f8ab94
commit 2a406f3ce5
64 changed files with 488 additions and 488 deletions

View File

@ -25,7 +25,7 @@
package java.lang;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/** The CharacterData class encapsulates the large tables found in
Java.lang.Character. */
@ -80,18 +80,18 @@ class CharacterDataLatin1 extends CharacterData {
return props;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
boolean isDigit(int ch) {
return '0' <= ch && ch <= '9';
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
boolean isLowerCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.LOWERCASE_LETTER;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
boolean isUpperCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.UPPERCASE_LETTER;
@ -232,7 +232,7 @@ class CharacterDataLatin1 extends CharacterData {
return retval;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
boolean isWhitespace(int ch) {
int props = getProperties(ch);
return ((props & $$maskIdentifierInfo) == $$valueJavaWhitespace);

View File

@ -2258,7 +2258,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
// Search for Non-ASCII character (Negative byte value) in a byte array,
// return true if it has any and false otherwise.
// ..\jdk\src\java.base\share\classes\java\lang\StringCoding.java
// @HotSpotIntrinsicCandidate
// @IntrinsicCandidate
// private static boolean hasNegatives(byte[] ba, int off, int len) {
// for (int i = off; i < off + len; i++) {
// if (ba[i] < 0) {

View File

@ -5133,7 +5133,7 @@ void MacroAssembler::generate_fill(BasicType t, bool aligned,
}
// encode char[] to byte[] in ISO_8859_1
//@HotSpotIntrinsicCandidate
//@IntrinsicCandidate
//private static int implEncodeISOArray(byte[] sa, int sp,
//byte[] da, int dp, int len) {
// int i = 0;
@ -7510,7 +7510,7 @@ void MacroAssembler::crc32c_ipl_alg2_alt2(Register in_out, Register in1, Registe
// Compress char[] array to byte[].
// ..\jdk\src\java.base\share\classes\java\lang\StringUTF16.java
// @HotSpotIntrinsicCandidate
// @IntrinsicCandidate
// private static int compress(char[] src, int srcOff, byte[] dst, int dstOff, int len) {
// for (int i = 0; i < len; i++) {
// int c = src[srcOff++];
@ -7726,7 +7726,7 @@ void MacroAssembler::char_array_compress(Register src, Register dst, Register le
// Inflate byte[] array to char[].
// ..\jdk\src\java.base\share\classes\java\lang\StringLatin1.java
// @HotSpotIntrinsicCandidate
// @IntrinsicCandidate
// private static void inflate(byte[] src, int srcOff, char[] dst, int dstOff, int len) {
// for (int i = 0; i < len; i++) {
// dst[dstOff++] = (char)(src[srcOff++] & 0xff);

View File

@ -1079,7 +1079,7 @@ public:
_method_InjectedProfile,
_method_LambdaForm_Compiled,
_method_Hidden,
_method_HotSpotIntrinsicCandidate,
_method_IntrinsicCandidate,
_jdk_internal_vm_annotation_Contended,
_field_Stable,
_jdk_internal_vm_annotation_ReservedStackAccess,
@ -2102,10 +2102,10 @@ AnnotationCollector::annotation_index(const ClassLoaderData* loader_data,
if (!privileged) break; // only allow in privileged code
return _method_Hidden;
}
case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_HotSpotIntrinsicCandidate_signature): {
case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_IntrinsicCandidate_signature): {
if (_location != _in_method) break; // only allow for methods
if (!privileged) break; // only allow in privileged code
return _method_HotSpotIntrinsicCandidate;
return _method_IntrinsicCandidate;
}
case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_Stable_signature): {
if (_location != _in_field) break; // only allow for fields
@ -2159,7 +2159,7 @@ void MethodAnnotationCollector::apply_to(const methodHandle& m) {
m->set_intrinsic_id(vmIntrinsics::_compiledLambdaForm);
if (has_annotation(_method_Hidden))
m->set_hidden(true);
if (has_annotation(_method_HotSpotIntrinsicCandidate) && !m->is_synthetic())
if (has_annotation(_method_IntrinsicCandidate) && !m->is_synthetic())
m->set_intrinsic_candidate(true);
if (has_annotation(_jdk_internal_vm_annotation_ReservedStackAccess))
m->set_has_reserved_stack_access(true);
@ -5165,22 +5165,22 @@ static void check_methods_for_intrinsics(const InstanceKlass* ik,
if (CheckIntrinsics) {
// Check if an intrinsic is defined for method 'method',
// but the method is not annotated with @HotSpotIntrinsicCandidate.
// but the method is not annotated with @IntrinsicCandidate.
if (method->intrinsic_id() != vmIntrinsics::_none &&
!method->intrinsic_candidate()) {
tty->print("Compiler intrinsic is defined for method [%s], "
"but the method is not annotated with @HotSpotIntrinsicCandidate.%s",
"but the method is not annotated with @IntrinsicCandidate.%s",
method->name_and_sig_as_C_string(),
NOT_DEBUG(" Method will not be inlined.") DEBUG_ONLY(" Exiting.")
);
tty->cr();
DEBUG_ONLY(vm_exit(1));
}
// Check is the method 'method' is annotated with @HotSpotIntrinsicCandidate,
// Check is the method 'method' is annotated with @IntrinsicCandidate,
// but there is no intrinsic available for it.
if (method->intrinsic_candidate() &&
method->intrinsic_id() == vmIntrinsics::_none) {
tty->print("Method [%s] is annotated with @HotSpotIntrinsicCandidate, "
tty->print("Method [%s] is annotated with @IntrinsicCandidate, "
"but no compiler intrinsic is defined for the method.%s",
method->name_and_sig_as_C_string(),
NOT_DEBUG("") DEBUG_ONLY(" Exiting.")

View File

@ -76,7 +76,7 @@
// in the (Java) source code and the semantics of the method as defined
// by the code in the VM, intrinsic methods must be explicitly marked.
//
// Intrinsic methods are marked by the jdk.internal.HotSpotIntrinsicCandidate
// Intrinsic methods are marked by the jdk.internal.vm.annotation.IntrinsicCandidate
// annotation. If CheckIntrinsics is enabled, the VM performs the following
// checks when a class C is loaded: (1) all intrinsics defined by the VM for
// class C are present in the loaded class file and are marked;

View File

@ -284,10 +284,10 @@
template(type_annotations_name, "typeAnnotations") \
\
/* Intrinsic Annotation (JDK 9 and above) */ \
template(jdk_internal_HotSpotIntrinsicCandidate_signature, "Ljdk/internal/HotSpotIntrinsicCandidate;") \
template(jdk_internal_vm_annotation_DontInline_signature, "Ljdk/internal/vm/annotation/DontInline;") \
template(jdk_internal_vm_annotation_ForceInline_signature, "Ljdk/internal/vm/annotation/ForceInline;") \
template(jdk_internal_vm_annotation_Hidden_signature, "Ljdk/internal/vm/annotation/Hidden;") \
template(jdk_internal_vm_annotation_IntrinsicCandidate_signature, "Ljdk/internal/vm/annotation/IntrinsicCandidate;") \
template(jdk_internal_vm_annotation_Stable_signature, "Ljdk/internal/vm/annotation/Stable;") \
\
/* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */ \

View File

@ -2421,10 +2421,10 @@ const intx ObjectAlignmentInBytes = 8;
"When a class C is loaded, check that " \
"(1) all intrinsics defined by the VM for class C are present "\
"in the loaded class file and are marked with the " \
"@HotSpotIntrinsicCandidate annotation, that " \
"@IntrinsicCandidate annotation, that " \
"(2) there is an intrinsic registered for all loaded methods " \
"that are annotated with the @HotSpotIntrinsicCandidate " \
"annotation, and that " \
"that are annotated with the @IntrinsicCandidate annotation, " \
"and that " \
"(3) no orphan methods exist for class C (i.e., methods for " \
"which the VM declares an intrinsic but that are not declared "\
"in the loaded class C. " \

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -40,7 +40,7 @@ import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.util.Arrays;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* Rijndael --pronounced Reindaal-- is a symmetric cipher with a 128-bit
@ -356,7 +356,7 @@ final class AESCrypt extends SymmetricCipher implements AESConstants
}
// Encryption operation. Possibly replaced with a compiler intrinsic.
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private void implEncryptBlock(byte[] in, int inOffset,
byte[] out, int outOffset)
{
@ -435,7 +435,7 @@ final class AESCrypt extends SymmetricCipher implements AESConstants
}
// Decrypt operation. Possibly replaced with a compiler intrinsic.
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private void implDecryptBlock(byte[] in, int inOffset,
byte[] out, int outOffset)
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,7 +29,7 @@ import java.security.InvalidKeyException;
import java.security.ProviderException;
import java.util.Objects;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import sun.security.util.ArrayUtil;
@ -153,7 +153,7 @@ class CipherBlockChaining extends FeedbackCipher {
cipher, cipherOffset);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private int implEncrypt(byte[] plain, int plainOffset, int plainLen,
byte[] cipher, int cipherOffset)
{
@ -203,7 +203,7 @@ class CipherBlockChaining extends FeedbackCipher {
return implDecrypt(cipher, cipherOffset, cipherLen, plain, plainOffset);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private int implDecrypt(byte[] cipher, int cipherOffset, int cipherLen,
byte[] plain, int plainOffset)
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,7 +27,7 @@ package com.sun.crypto.provider;
import java.security.InvalidKeyException;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import sun.security.util.ArrayUtil;
/**
@ -182,7 +182,7 @@ class CounterMode extends FeedbackCipher {
}
// Implementation of crpyt() method. Possibly replaced with a compiler intrinsic.
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private int implCrypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
int result = len;
while (len-- > 0) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,7 +29,7 @@ import java.security.InvalidKeyException;
import java.security.ProviderException;
import sun.security.util.ArrayUtil;
import java.util.Objects;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* This class represents ciphers in electronic codebook (ECB) mode.
@ -97,7 +97,7 @@ final class ElectronicCodeBook extends FeedbackCipher {
embeddedCipher.init(decrypting, algorithm, key);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private int implECBEncrypt(byte [] in, int inOff, int len, byte[] out, int outOff) {
for (int i = len; i >= blockSize; i -= blockSize) {
embeddedCipher.encryptBlock(in, inOff, out, outOff);
@ -131,7 +131,7 @@ final class ElectronicCodeBook extends FeedbackCipher {
return implECBEncrypt(in, inOff, len, out, outOff);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private int implECBDecrypt(byte [] in, int inOff, int len, byte[] out, int outOff) {
for (int i = len; i >= blockSize; i -= blockSize) {
embeddedCipher.decryptBlock(in, inOff, out, outOff);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -31,7 +31,7 @@ package com.sun.crypto.provider;
import java.security.ProviderException;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* This class represents the GHASH function defined in NIST 800-38D
@ -229,7 +229,7 @@ final class GHASH {
* the hotspot signature. This method and methods called by it, cannot
* throw exceptions or allocate arrays as it will breaking intrinsics
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static void processBlocks(byte[] data, int inOfs, int blocks, long[] st, long[] subH) {
int offset = inOfs;
while (blocks > 0) {

View File

@ -25,7 +25,7 @@
package java.lang;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import java.lang.constant.Constable;
import java.lang.constant.ConstantDesc;
@ -148,7 +148,7 @@ public final class Boolean implements java.io.Serializable,
*
* @return the primitive {@code boolean} value of this object.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public boolean booleanValue() {
return value;
}
@ -167,7 +167,7 @@ public final class Boolean implements java.io.Serializable,
* @return a {@code Boolean} instance representing {@code b}.
* @since 1.4
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static Boolean valueOf(boolean b) {
return (b ? TRUE : FALSE);
}

View File

@ -25,8 +25,8 @@
package java.lang;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.CDS;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import java.lang.constant.Constable;
import java.lang.constant.DynamicConstantDesc;
@ -134,7 +134,7 @@ public final class Byte extends Number implements Comparable<Byte>, Constable {
* @return a {@code Byte} instance representing {@code b}.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static Byte valueOf(byte b) {
final int offset = 128;
return ByteCache.cache[(int)b + offset];
@ -369,7 +369,7 @@ public final class Byte extends Number implements Comparable<Byte>, Constable {
* Returns the value of this {@code Byte} as a
* {@code byte}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public byte byteValue() {
return value;
}

View File

@ -25,8 +25,8 @@
package java.lang;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.CDS;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import java.lang.constant.Constable;
import java.lang.constant.DynamicConstantDesc;
@ -8545,7 +8545,7 @@ class Character implements java.io.Serializable, Comparable<Character>, Constabl
* @return a {@code Character} instance representing {@code c}.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static Character valueOf(char c) {
if (c <= 127) { // must cache
return CharacterCache.cache[(int)c];
@ -8558,7 +8558,7 @@ class Character implements java.io.Serializable, Comparable<Character>, Constabl
* @return the primitive {@code char} value represented by
* this object.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public char charValue() {
return value;
}
@ -11252,7 +11252,7 @@ class Character implements java.io.Serializable, Comparable<Character>, Constabl
* the bytes in the specified {@code char} value.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static char reverseBytes(char ch) {
return (char) (((ch & 0xFF00) >> 8) | (ch << 8));
}

View File

@ -66,7 +66,6 @@ import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.loader.BootLoader;
import jdk.internal.loader.BuiltinClassLoader;
import jdk.internal.misc.Unsafe;
@ -76,6 +75,7 @@ import jdk.internal.reflect.ConstantPool;
import jdk.internal.reflect.Reflection;
import jdk.internal.reflect.ReflectionFactory;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import sun.invoke.util.Wrapper;
import sun.reflect.generics.factory.CoreReflectionFactory;
import sun.reflect.generics.factory.GenericsFactory;
@ -682,7 +682,7 @@ public final class Class<T> implements java.io.Serializable,
*
* @since 1.1
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native boolean isInstance(Object obj);
@ -711,7 +711,7 @@ public final class Class<T> implements java.io.Serializable,
* null.
* @since 1.1
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native boolean isAssignableFrom(Class<?> cls);
@ -722,7 +722,7 @@ public final class Class<T> implements java.io.Serializable,
* @return {@code true} if this {@code Class} object represents an interface;
* {@code false} otherwise.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native boolean isInterface();
@ -733,7 +733,7 @@ public final class Class<T> implements java.io.Serializable,
* {@code false} otherwise.
* @since 1.1
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native boolean isArray();
@ -765,7 +765,7 @@ public final class Class<T> implements java.io.Serializable,
* @see java.lang.Void#TYPE
* @since 1.1
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native boolean isPrimitive();
/**
@ -976,7 +976,7 @@ public final class Class<T> implements java.io.Serializable,
*
* @return the direct superclass of the class represented by this {@code Class} object
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native Class<? super T> getSuperclass();
@ -1275,7 +1275,7 @@ public final class Class<T> implements java.io.Serializable,
* @see java.lang.reflect.Modifier
* @since 1.1
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native int getModifiers();
@ -3810,7 +3810,7 @@ public final class Class<T> implements java.io.Serializable,
* @since 1.5
*/
@SuppressWarnings("unchecked")
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public T cast(Object obj) {
if (obj != null && !isInstance(obj))
throw new ClassCastException(cannotCastMsg(obj));
@ -4381,7 +4381,7 @@ public final class Class<T> implements java.io.Serializable,
* @since 15
* @see MethodHandles.Lookup#defineHiddenClass
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native boolean isHidden();
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -32,7 +32,7 @@ import java.util.Optional;
import jdk.internal.math.FloatingDecimal;
import jdk.internal.math.DoubleConsts;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* The {@code Double} class wraps a value of the primitive type
@ -525,7 +525,7 @@ public final class Double extends Number
* @return a {@code Double} instance representing {@code d}.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static Double valueOf(double d) {
return new Double(d);
}
@ -735,7 +735,7 @@ public final class Double extends Number
*
* @return the {@code double} value represented by this object
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public double doubleValue() {
return value;
}
@ -856,7 +856,7 @@ public final class Double extends Number
* @param value a {@code double} precision floating-point number.
* @return the bits that represent the floating-point number.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static long doubleToLongBits(double value) {
if (!isNaN(value)) {
return doubleToRawLongBits(value);
@ -900,7 +900,7 @@ public final class Double extends Number
* @return the bits that represent the floating-point number.
* @since 1.3
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native long doubleToRawLongBits(double value);
/**
@ -964,7 +964,7 @@ public final class Double extends Number
* @return the {@code double} floating-point value with the same
* bit pattern.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native double longBitsToDouble(long bits);
/**

View File

@ -31,7 +31,7 @@ import java.lang.constant.ConstantDesc;
import java.util.Optional;
import jdk.internal.math.FloatingDecimal;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* The {@code Float} class wraps a value of primitive type
@ -438,7 +438,7 @@ public final class Float extends Number
* @return a {@code Float} instance representing {@code f}.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static Float valueOf(float f) {
return new Float(f);
}
@ -650,7 +650,7 @@ public final class Float extends Number
*
* @return the {@code float} value represented by this object
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public float floatValue() {
return value;
}
@ -768,7 +768,7 @@ public final class Float extends Number
* @param value a floating-point number.
* @return the bits that represent the floating-point number.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int floatToIntBits(float value) {
if (!isNaN(value)) {
return floatToRawIntBits(value);
@ -811,7 +811,7 @@ public final class Float extends Number
* @return the bits that represent the floating-point number.
* @since 1.3
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native int floatToRawIntBits(float value);
/**
@ -873,7 +873,7 @@ public final class Float extends Number
* @return the {@code float} floating-point value with the same bit
* pattern.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native float intBitsToFloat(int bits);
/**

View File

@ -32,9 +32,9 @@ import java.lang.constant.ConstantDesc;
import java.util.Objects;
import java.util.Optional;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.CDS;
import jdk.internal.misc.VM;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import static java.lang.String.COMPACT_STRINGS;
import static java.lang.String.LATIN1;
@ -434,7 +434,7 @@ public final class Integer extends Number
* @param i an integer to be converted.
* @return a string representation of the argument in base&nbsp;10.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static String toString(int i) {
int size = stringSize(i);
if (COMPACT_STRINGS) {
@ -1059,7 +1059,7 @@ public final class Integer extends Number
* @return an {@code Integer} instance representing {@code i}.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static Integer valueOf(int i) {
if (i >= IntegerCache.low && i <= IntegerCache.high)
return IntegerCache.cache[i + (-IntegerCache.low)];
@ -1134,7 +1134,7 @@ public final class Integer extends Number
* Returns the value of this {@code Integer} as an
* {@code int}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public int intValue() {
return value;
}
@ -1632,7 +1632,7 @@ public final class Integer extends Number
* is equal to zero.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int numberOfLeadingZeros(int i) {
// HD, Count leading 0's
if (i <= 0)
@ -1659,7 +1659,7 @@ public final class Integer extends Number
* to zero.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int numberOfTrailingZeros(int i) {
// HD, Count trailing 0's
i = ~i & (i - 1);
@ -1682,7 +1682,7 @@ public final class Integer extends Number
* representation of the specified {@code int} value.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int bitCount(int i) {
// HD, Figure 5-2
i = i - ((i >>> 1) & 0x55555555);
@ -1783,7 +1783,7 @@ public final class Integer extends Number
* {@code int} value.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int reverseBytes(int i) {
return (i << 24) |
((i & 0xff00) << 8) |

View File

@ -33,8 +33,8 @@ import java.math.*;
import java.util.Objects;
import java.util.Optional;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.CDS;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import static java.lang.String.COMPACT_STRINGS;
import static java.lang.String.LATIN1;
@ -1198,7 +1198,7 @@ public final class Long extends Number
* @return a {@code Long} instance representing {@code l}.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static Long valueOf(long l) {
final int offset = 128;
if (l >= -128 && l <= 127) { // will cache
@ -1375,7 +1375,7 @@ public final class Long extends Number
* Returns the value of this {@code Long} as a
* {@code long} value.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public long longValue() {
return value;
}
@ -1786,7 +1786,7 @@ public final class Long extends Number
* is equal to zero.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int numberOfLeadingZeros(long i) {
int x = (int)(i >>> 32);
return x == 0 ? 32 + Integer.numberOfLeadingZeros((int)i)
@ -1807,7 +1807,7 @@ public final class Long extends Number
* to zero.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int numberOfTrailingZeros(long i) {
int x = (int)i;
return x == 0 ? 32 + Integer.numberOfTrailingZeros((int)(i >>> 32))
@ -1824,7 +1824,7 @@ public final class Long extends Number
* representation of the specified {@code long} value.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int bitCount(long i) {
// HD, Figure 5-2
i = i - ((i >>> 1) & 0x5555555555555555L);
@ -1926,7 +1926,7 @@ public final class Long extends Number
* {@code long} value.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static long reverseBytes(long i) {
i = (i & 0x00ff00ff00ff00ffL) << 8 | (i >>> 8) & 0x00ff00ff00ff00ffL;
return (i << 48) | ((i & 0xffff0000L) << 16) |

View File

@ -29,7 +29,7 @@ import java.math.BigDecimal;
import java.util.Random;
import jdk.internal.math.FloatConsts;
import jdk.internal.math.DoubleConsts;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* The class {@code Math} contains methods for performing basic
@ -149,7 +149,7 @@ public final class Math {
* @param a an angle, in radians.
* @return the sine of the argument.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double sin(double a) {
return StrictMath.sin(a); // default impl. delegates to StrictMath
}
@ -165,7 +165,7 @@ public final class Math {
* @param a an angle, in radians.
* @return the cosine of the argument.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double cos(double a) {
return StrictMath.cos(a); // default impl. delegates to StrictMath
}
@ -183,7 +183,7 @@ public final class Math {
* @param a an angle, in radians.
* @return the tangent of the argument.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double tan(double a) {
return StrictMath.tan(a); // default impl. delegates to StrictMath
}
@ -285,7 +285,7 @@ public final class Math {
* @return the value <i>e</i><sup>{@code a}</sup>,
* where <i>e</i> is the base of the natural logarithms.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double exp(double a) {
return StrictMath.exp(a); // default impl. delegates to StrictMath
}
@ -307,7 +307,7 @@ public final class Math {
* @return the value ln&nbsp;{@code a}, the natural logarithm of
* {@code a}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double log(double a) {
return StrictMath.log(a); // default impl. delegates to StrictMath
}
@ -333,7 +333,7 @@ public final class Math {
* @return the base 10 logarithm of {@code a}.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double log10(double a) {
return StrictMath.log10(a); // default impl. delegates to StrictMath
}
@ -355,7 +355,7 @@ public final class Math {
* @return the positive square root of {@code a}.
* If the argument is NaN or less than zero, the result is NaN.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double sqrt(double a) {
return StrictMath.sqrt(a); // default impl. delegates to StrictMath
// Note that hardware sqrt instructions
@ -440,7 +440,7 @@ public final class Math {
* floating-point value that is greater than or equal to
* the argument and is equal to a mathematical integer.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double ceil(double a) {
return StrictMath.ceil(a); // default impl. delegates to StrictMath
}
@ -460,7 +460,7 @@ public final class Math {
* floating-point value that less than or equal to the argument
* and is equal to a mathematical integer.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double floor(double a) {
return StrictMath.floor(a); // default impl. delegates to StrictMath
}
@ -480,7 +480,7 @@ public final class Math {
* @return the closest floating-point value to {@code a} that is
* equal to a mathematical integer.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double rint(double a) {
return StrictMath.rint(a); // default impl. delegates to StrictMath
}
@ -537,7 +537,7 @@ public final class Math {
* in polar coordinates that corresponds to the point
* (<i>x</i>,&nbsp;<i>y</i>) in Cartesian coordinates.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double atan2(double y, double x) {
return StrictMath.atan2(y, x); // default impl. delegates to StrictMath
}
@ -665,7 +665,7 @@ public final class Math {
* @param b the exponent.
* @return the value {@code a}<sup>{@code b}</sup>.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double pow(double a, double b) {
return StrictMath.pow(a, b); // default impl. delegates to StrictMath
}
@ -820,7 +820,7 @@ public final class Math {
* @throws ArithmeticException if the result overflows an int
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int addExact(int x, int y) {
int r = x + y;
// HD 2-12 Overflow iff both arguments have the opposite sign of the result
@ -840,7 +840,7 @@ public final class Math {
* @throws ArithmeticException if the result overflows a long
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static long addExact(long x, long y) {
long r = x + y;
// HD 2-12 Overflow iff both arguments have the opposite sign of the result
@ -860,7 +860,7 @@ public final class Math {
* @throws ArithmeticException if the result overflows an int
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int subtractExact(int x, int y) {
int r = x - y;
// HD 2-12 Overflow iff the arguments have different signs and
@ -881,7 +881,7 @@ public final class Math {
* @throws ArithmeticException if the result overflows a long
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static long subtractExact(long x, long y) {
long r = x - y;
// HD 2-12 Overflow iff the arguments have different signs and
@ -902,7 +902,7 @@ public final class Math {
* @throws ArithmeticException if the result overflows an int
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int multiplyExact(int x, int y) {
long r = (long)x * (long)y;
if ((int)r != r) {
@ -935,7 +935,7 @@ public final class Math {
* @throws ArithmeticException if the result overflows a long
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static long multiplyExact(long x, long y) {
long r = x * y;
long ax = Math.abs(x);
@ -962,7 +962,7 @@ public final class Math {
* @throws ArithmeticException if the result overflows an int
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int incrementExact(int a) {
if (a == Integer.MAX_VALUE) {
throw new ArithmeticException("integer overflow");
@ -981,7 +981,7 @@ public final class Math {
* @throws ArithmeticException if the result overflows a long
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static long incrementExact(long a) {
if (a == Long.MAX_VALUE) {
throw new ArithmeticException("long overflow");
@ -1000,7 +1000,7 @@ public final class Math {
* @throws ArithmeticException if the result overflows an int
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int decrementExact(int a) {
if (a == Integer.MIN_VALUE) {
throw new ArithmeticException("integer overflow");
@ -1019,7 +1019,7 @@ public final class Math {
* @throws ArithmeticException if the result overflows a long
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static long decrementExact(long a) {
if (a == Long.MIN_VALUE) {
throw new ArithmeticException("long overflow");
@ -1038,7 +1038,7 @@ public final class Math {
* @throws ArithmeticException if the result overflows an int
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int negateExact(int a) {
if (a == Integer.MIN_VALUE) {
throw new ArithmeticException("integer overflow");
@ -1057,7 +1057,7 @@ public final class Math {
* @throws ArithmeticException if the result overflows a long
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static long negateExact(long a) {
if (a == Long.MIN_VALUE) {
throw new ArithmeticException("long overflow");
@ -1103,7 +1103,7 @@ public final class Math {
* @return the result
* @since 9
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static long multiplyHigh(long x, long y) {
if (x < 0 || y < 0) {
// Use technique from section 8-2 of Henry S. Warren, Jr.,
@ -1365,7 +1365,7 @@ public final class Math {
* @return the absolute value of the argument.
* @see Math#absExact(int)
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int abs(int a) {
return (a < 0) ? -a : a;
}
@ -1411,7 +1411,7 @@ public final class Math {
* @return the absolute value of the argument.
* @see Math#absExact(long)
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static long abs(long a) {
return (a < 0) ? -a : a;
}
@ -1462,7 +1462,7 @@ public final class Math {
* @param a the argument whose absolute value is to be determined
* @return the absolute value of the argument.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static float abs(float a) {
return (a <= 0.0F) ? 0.0F - a : a;
}
@ -1487,7 +1487,7 @@ public final class Math {
* @param a the argument whose absolute value is to be determined
* @return the absolute value of the argument.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double abs(double a) {
return (a <= 0.0D) ? 0.0D - a : a;
}
@ -1502,7 +1502,7 @@ public final class Math {
* @param b another argument.
* @return the larger of {@code a} and {@code b}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int max(int a, int b) {
return (a >= b) ? a : b;
}
@ -1539,7 +1539,7 @@ public final class Math {
* @param b another argument.
* @return the larger of {@code a} and {@code b}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static float max(float a, float b) {
if (a != a)
return a; // a is NaN
@ -1566,7 +1566,7 @@ public final class Math {
* @param b another argument.
* @return the larger of {@code a} and {@code b}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double max(double a, double b) {
if (a != a)
return a; // a is NaN
@ -1589,7 +1589,7 @@ public final class Math {
* @param b another argument.
* @return the smaller of {@code a} and {@code b}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int min(int a, int b) {
return (a <= b) ? a : b;
}
@ -1622,7 +1622,7 @@ public final class Math {
* @param b another argument.
* @return the smaller of {@code a} and {@code b}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static float min(float a, float b) {
if (a != a)
return a; // a is NaN
@ -1649,7 +1649,7 @@ public final class Math {
* @param b another argument.
* @return the smaller of {@code a} and {@code b}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double min(double a, double b) {
if (a != a)
return a; // a is NaN
@ -1712,7 +1712,7 @@ public final class Math {
*
* @since 9
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double fma(double a, double b, double c) {
/*
* Infinity and NaN arithmetic is not quite the same with two
@ -1829,7 +1829,7 @@ public final class Math {
*
* @since 9
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static float fma(float a, float b, float c) {
/*
* Since the double format has more than twice the precision
@ -1977,7 +1977,7 @@ public final class Math {
* @author Joseph D. Darcy
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double signum(double d) {
return (d == 0.0 || Double.isNaN(d))?d:copySign(1.0, d);
}
@ -1999,7 +1999,7 @@ public final class Math {
* @author Joseph D. Darcy
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static float signum(float f) {
return (f == 0.0f || Float.isNaN(f))?f:copySign(1.0f, f);
}
@ -2220,7 +2220,7 @@ public final class Math {
* and the sign of {@code sign}.
* @since 1.6
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double copySign(double magnitude, double sign) {
return Double.longBitsToDouble((Double.doubleToRawLongBits(sign) &
(DoubleConsts.SIGN_BIT_MASK)) |
@ -2244,7 +2244,7 @@ public final class Math {
* and the sign of {@code sign}.
* @since 1.6
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static float copySign(float magnitude, float sign) {
return Float.intBitsToFloat((Float.floatToRawIntBits(sign) &
(FloatConsts.SIGN_BIT_MASK)) |

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,7 +25,7 @@
package java.lang;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* Class {@code Object} is the root of the class hierarchy.
@ -41,7 +41,7 @@ public class Object {
/**
* Constructs a new object.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public Object() {}
/**
@ -63,7 +63,7 @@ public class Object {
* class of this object.
* @jls 15.8.2 Class Literals
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native Class<?> getClass();
/**
@ -98,7 +98,7 @@ public class Object {
* @see java.lang.Object#equals(java.lang.Object)
* @see java.lang.System#identityHashCode
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native int hashCode();
/**
@ -211,7 +211,7 @@ public class Object {
* be cloned.
* @see java.lang.Cloneable
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
protected native Object clone() throws CloneNotSupportedException;
/**
@ -271,7 +271,7 @@ public class Object {
* @see java.lang.Object#notifyAll()
* @see java.lang.Object#wait()
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native void notify();
/**
@ -296,7 +296,7 @@ public class Object {
* @see java.lang.Object#notify()
* @see java.lang.Object#wait()
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native void notifyAll();
/**

View File

@ -25,8 +25,8 @@
package java.lang;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.CDS;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import java.lang.constant.Constable;
import java.lang.constant.DynamicConstantDesc;
@ -263,7 +263,7 @@ public final class Short extends Number implements Comparable<Short>, Constable
* @return a {@code Short} instance representing {@code s}.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static Short valueOf(short s) {
final int offset = 128;
int sAsInt = s;
@ -383,7 +383,7 @@ public final class Short extends Number implements Comparable<Short>, Constable
* Returns the value of this {@code Short} as a
* {@code short}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public short shortValue() {
return value;
}
@ -553,7 +553,7 @@ public final class Short extends Number implements Comparable<Short>, Constable
* the bytes in the specified {@code short} value.
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static short reverseBytes(short i) {
return (short) (((i & 0xFF00) >> 8) | (i << 8));
}

View File

@ -27,7 +27,7 @@ package java.lang;
import java.util.Random;
import jdk.internal.math.DoubleConsts;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* The class {@code StrictMath} contains methods for performing basic
@ -283,7 +283,7 @@ public final class StrictMath {
* @param a a value.
* @return the positive square root of {@code a}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native double sqrt(double a);
/**
@ -1261,7 +1261,7 @@ public final class StrictMath {
* @param b another argument.
* @return the larger of {@code a} and {@code b}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int max(int a, int b) {
return Math.max(a, b);
}
@ -1294,7 +1294,7 @@ public final class StrictMath {
* @param b another argument.
* @return the larger of {@code a} and {@code b}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static float max(float a, float b) {
return Math.max(a, b);
}
@ -1313,7 +1313,7 @@ public final class StrictMath {
* @param b another argument.
* @return the larger of {@code a} and {@code b}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double max(double a, double b) {
return Math.max(a, b);
}
@ -1328,7 +1328,7 @@ public final class StrictMath {
* @param b another argument.
* @return the smaller of {@code a} and {@code b}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int min(int a, int b) {
return Math.min(a, b);
}
@ -1361,7 +1361,7 @@ public final class StrictMath {
* @param b another argument.
* @return the smaller of {@code a} and {@code b.}
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static float min(float a, float b) {
return Math.min(a, b);
}
@ -1380,7 +1380,7 @@ public final class StrictMath {
* @param b another argument.
* @return the smaller of {@code a} and {@code b}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static double min(double a, double b) {
return Math.min(a, b);
}

View File

@ -49,7 +49,7 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import jdk.internal.vm.annotation.Stable;
import static java.util.function.Predicate.not;
@ -248,7 +248,7 @@ public final class String
* @param original
* A {@code String}
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public String(String original) {
this.value = original.value;
this.coder = original.coder;

View File

@ -27,7 +27,7 @@ package java.lang;
import java.io.IOException;
import java.util.Arrays;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* A thread-safe, mutable sequence of characters.
@ -123,7 +123,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
* Constructs a string buffer with no characters in it and an
* initial capacity of 16 characters.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public StringBuffer() {
super(16);
}
@ -136,7 +136,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
* @throws NegativeArraySizeException if the {@code capacity}
* argument is less than {@code 0}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public StringBuffer(int capacity) {
super(capacity);
}
@ -148,7 +148,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
*
* @param str the initial contents of the buffer.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public StringBuffer(String str) {
super(str);
}
@ -302,7 +302,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
}
@Override
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public synchronized StringBuffer append(String str) {
toStringCache = null;
super.append(str);
@ -414,7 +414,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
}
@Override
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public synchronized StringBuffer append(char c) {
toStringCache = null;
super.append(c);
@ -422,7 +422,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
}
@Override
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public synchronized StringBuffer append(int i) {
toStringCache = null;
super.append(i);
@ -704,7 +704,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
}
@Override
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public synchronized String toString() {
if (toStringCache == null) {
return toStringCache =

View File

@ -25,7 +25,7 @@
package java.lang;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import java.io.IOException;
@ -97,7 +97,7 @@ public final class StringBuilder
* Constructs a string builder with no characters in it and an
* initial capacity of 16 characters.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public StringBuilder() {
super(16);
}
@ -110,7 +110,7 @@ public final class StringBuilder
* @throws NegativeArraySizeException if the {@code capacity}
* argument is less than {@code 0}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public StringBuilder(int capacity) {
super(capacity);
}
@ -122,7 +122,7 @@ public final class StringBuilder
*
* @param str the initial contents of the buffer.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public StringBuilder(String str) {
super(str);
}
@ -170,7 +170,7 @@ public final class StringBuilder
}
@Override
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public StringBuilder append(String str) {
super.append(str);
return this;
@ -237,14 +237,14 @@ public final class StringBuilder
}
@Override
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public StringBuilder append(char c) {
super.append(c);
return this;
}
@Override
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public StringBuilder append(int i) {
super.append(i);
return this;
@ -443,7 +443,7 @@ public final class StringBuilder
}
@Override
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public String toString() {
// Create a copy, don't share the array
return isLatin1() ? StringLatin1.newString(value, 0, count)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -40,7 +40,7 @@ import java.nio.charset.MalformedInputException;
import java.nio.charset.UnmappableCharacterException;
import java.nio.charset.UnsupportedCharsetException;
import java.util.Arrays;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.ArrayDecoder;
import sun.nio.cs.ArrayEncoder;
@ -139,7 +139,7 @@ class StringCoding {
}
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static boolean hasNegatives(byte[] ba, int off, int len) {
for (int i = off; i < off + len; i++) {
if (ba[i] < 0) {
@ -590,7 +590,7 @@ class StringCoding {
}
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static int implEncodeISOArray(byte[] sa, int sp,
byte[] da, int dp, int len) {
int i = 0;

View File

@ -34,8 +34,8 @@ import java.util.function.IntConsumer;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.util.ArraysSupport;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import static java.lang.String.LATIN1;
import static java.lang.String.UTF16;
@ -90,7 +90,7 @@ final class StringLatin1 {
System.arraycopy(value, srcBegin, dst, dstBegin, srcEnd - srcBegin);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static boolean equals(byte[] value, byte[] other) {
if (value.length == other.length) {
for (int i = 0; i < value.length; i++) {
@ -103,7 +103,7 @@ final class StringLatin1 {
return false;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int compareTo(byte[] value, byte[] other) {
int len1 = value.length;
int len2 = other.length;
@ -120,7 +120,7 @@ final class StringLatin1 {
return len1 - len2;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int compareToUTF16(byte[] value, byte[] other) {
int len1 = length(value);
int len2 = StringUTF16.length(other);
@ -219,7 +219,7 @@ final class StringLatin1 {
return -1;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int indexOf(byte[] value, byte[] str) {
if (str.length == 0) {
return 0;
@ -230,7 +230,7 @@ final class StringLatin1 {
return indexOf(value, value.length, str, str.length, 0);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int indexOf(byte[] value, int valueCount, byte[] str, int strCount, int fromIndex) {
byte first = str[0];
int max = (valueCount - strCount);
@ -770,7 +770,7 @@ final class StringLatin1 {
}
// inflatedCopy byte[] -> char[]
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static void inflate(byte[] src, int srcOff, char[] dst, int dstOff, int len) {
for (int i = 0; i < len; i++) {
dst[dstOff++] = (char)(src[srcOff++] & 0xff);
@ -778,7 +778,7 @@ final class StringLatin1 {
}
// inflatedCopy byte[] -> byte[]
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static void inflate(byte[] src, int srcOff, byte[] dst, int dstOff, int len) {
StringUTF16.inflate(src, srcOff, dst, dstOff, len);
}

View File

@ -32,10 +32,10 @@ import java.util.function.Consumer;
import java.util.function.IntConsumer;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.util.ArraysSupport;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.DontInline;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import static java.lang.String.UTF16;
import static java.lang.String.LATIN1;
@ -53,7 +53,7 @@ final class StringUTF16 {
return new byte[len << 1];
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
// intrinsic performs no bounds checks
static void putChar(byte[] val, int index, int c) {
assert index >= 0 && index < length(val) : "Trusted caller missed bounds check";
@ -62,7 +62,7 @@ final class StringUTF16 {
val[index] = (byte)(c >> LO_BYTE_SHIFT);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
// intrinsic performs no bounds checks
static char getChar(byte[] val, int index) {
assert index >= 0 && index < length(val) : "Trusted caller missed bounds check";
@ -147,7 +147,7 @@ final class StringUTF16 {
return dst;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static byte[] toBytes(char[] value, int off, int len) {
byte[] val = newBytesFor(len);
for (int i = 0; i < len; i++) {
@ -174,7 +174,7 @@ final class StringUTF16 {
}
// compressedCopy char[] -> byte[]
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int compress(char[] src, int srcOff, byte[] dst, int dstOff, int len) {
for (int i = 0; i < len; i++) {
char c = src[srcOff];
@ -190,7 +190,7 @@ final class StringUTF16 {
}
// compressedCopy byte[] -> byte[]
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int compress(byte[] src, int srcOff, byte[] dst, int dstOff, int len) {
// We need a range check here because 'getChar' has no checks
checkBoundsOffCount(srcOff, len, src);
@ -246,7 +246,7 @@ final class StringUTF16 {
return result;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static void getChars(byte[] value, int srcBegin, int srcEnd, char dst[], int dstBegin) {
// We need a range check here because 'getChar' has no checks
if (srcBegin < srcEnd) {
@ -266,7 +266,7 @@ final class StringUTF16 {
}
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static boolean equals(byte[] value, byte[] other) {
if (value.length == other.length) {
int len = value.length >> 1;
@ -280,7 +280,7 @@ final class StringUTF16 {
return false;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int compareTo(byte[] value, byte[] other) {
int len1 = length(value);
int len2 = length(other);
@ -309,7 +309,7 @@ final class StringUTF16 {
return len1 - len2;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int compareToLatin1(byte[] value, byte[] other) {
return -StringLatin1.compareToUTF16(other, value);
}
@ -437,7 +437,7 @@ final class StringUTF16 {
}
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int indexOf(byte[] value, byte[] str) {
if (str.length == 0) {
return 0;
@ -448,7 +448,7 @@ final class StringUTF16 {
return indexOfUnsafe(value, length(value), str, length(str), 0);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int indexOf(byte[] value, int valueCount, byte[] str, int strCount, int fromIndex) {
checkBoundsBeginEnd(fromIndex, valueCount, value);
checkBoundsBeginEnd(0, strCount, str);
@ -486,7 +486,7 @@ final class StringUTF16 {
/**
* Handles indexOf Latin1 substring in UTF16 string.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int indexOfLatin1(byte[] value, byte[] str) {
if (str.length == 0) {
return 0;
@ -497,7 +497,7 @@ final class StringUTF16 {
return indexOfLatin1Unsafe(value, length(value), str, str.length, 0);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int indexOfLatin1(byte[] src, int srcCount, byte[] tgt, int tgtCount, int fromIndex) {
checkBoundsBeginEnd(fromIndex, srcCount, src);
String.checkBoundsBeginEnd(0, tgtCount, tgt.length);
@ -532,7 +532,7 @@ final class StringUTF16 {
return -1;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static int indexOfChar(byte[] value, int ch, int fromIndex, int max) {
checkBoundsBeginEnd(fromIndex, max, value);
return indexOfCharUnsafe(value, ch, fromIndex, max);

View File

@ -69,7 +69,6 @@ import jdk.internal.module.ModuleBootstrap;
import jdk.internal.module.ServicesCatalog;
import jdk.internal.reflect.CallerSensitive;
import jdk.internal.reflect.Reflection;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.access.JavaLangAccess;
import jdk.internal.access.SharedSecrets;
import jdk.internal.misc.VM;
@ -77,6 +76,7 @@ import jdk.internal.logger.LoggerFinderLoader;
import jdk.internal.logger.LazyLoggers;
import jdk.internal.logger.LocalizedLoggerWrapper;
import jdk.internal.util.SystemProps;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import jdk.internal.vm.annotation.Stable;
import sun.nio.fs.DefaultFileSystemProvider;
import sun.reflect.annotation.AnnotationType;
@ -427,7 +427,7 @@ public final class System {
* the current time and midnight, January 1, 1970 UTC.
* @see java.util.Date
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native long currentTimeMillis();
/**
@ -471,7 +471,7 @@ public final class System {
* high-resolution time source, in nanoseconds
* @since 1.5
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native long nanoTime();
/**
@ -566,7 +566,7 @@ public final class System {
* @throws NullPointerException if either {@code src} or
* {@code dest} is {@code null}.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native void arraycopy(Object src, int srcPos,
Object dest, int destPos,
int length);
@ -584,7 +584,7 @@ public final class System {
* @see Object#hashCode
* @see java.util.Objects#hashCode(Object)
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native int identityHashCode(Object x);
/**

View File

@ -39,11 +39,11 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;
import jdk.internal.misc.TerminatingThreadLocal;
import sun.nio.ch.Interruptible;
import jdk.internal.reflect.CallerSensitive;
import jdk.internal.reflect.Reflection;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import sun.nio.ch.Interruptible;
import sun.security.util.SecurityConstants;
import jdk.internal.HotSpotIntrinsicCandidate;
/**
* A <i>thread</i> is a thread of execution in a program. The Java
@ -257,7 +257,7 @@ public class Thread implements Runnable {
*
* @return the currently executing thread.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native Thread currentThread();
/**
@ -373,7 +373,7 @@ public class Thread implements Runnable {
*
* @since 9
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static void onSpinWait() {}
/**

View File

@ -26,7 +26,7 @@
package java.lang.invoke;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import java.lang.constant.ClassDesc;
import java.lang.constant.Constable;
@ -499,7 +499,7 @@ public abstract class MethodHandle implements Constable {
* @throws WrongMethodTypeException if the target's type is not identical with the caller's symbolic type descriptor
* @throws Throwable anything thrown by the underlying method propagates unchanged through the method handle call
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native @PolymorphicSignature Object invokeExact(Object... args) throws Throwable;
/**
@ -537,7 +537,7 @@ public abstract class MethodHandle implements Constable {
* @throws ClassCastException if the target's type can be adjusted to the caller, but a reference cast fails
* @throws Throwable anything thrown by the underlying method propagates unchanged through the method handle call
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native @PolymorphicSignature Object invoke(Object... args) throws Throwable;
/**
@ -557,7 +557,7 @@ public abstract class MethodHandle implements Constable {
* @param args the signature-polymorphic parameter list, statically represented using varargs
* @return the signature-polymorphic result, statically represented using {@code Object}
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
/*non-public*/
final native @PolymorphicSignature Object invokeBasic(Object... args) throws Throwable;
@ -568,7 +568,7 @@ public abstract class MethodHandle implements Constable {
* @param args the signature-polymorphic parameter list, statically represented using varargs
* @return the signature-polymorphic result, statically represented using {@code Object}
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
/*non-public*/
static native @PolymorphicSignature Object linkToVirtual(Object... args) throws Throwable;
@ -579,7 +579,7 @@ public abstract class MethodHandle implements Constable {
* @param args the signature-polymorphic parameter list, statically represented using varargs
* @return the signature-polymorphic result, statically represented using {@code Object}
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
/*non-public*/
static native @PolymorphicSignature Object linkToStatic(Object... args) throws Throwable;
@ -590,7 +590,7 @@ public abstract class MethodHandle implements Constable {
* @param args the signature-polymorphic parameter list, statically represented using varargs
* @return the signature-polymorphic result, statically represented using {@code Object}
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
/*non-public*/
static native @PolymorphicSignature Object linkToSpecial(Object... args) throws Throwable;
@ -601,7 +601,7 @@ public abstract class MethodHandle implements Constable {
* @param args the signature-polymorphic parameter list, statically represented using varargs
* @return the signature-polymorphic result, statically represented using {@code Object}
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
/*non-public*/
static native @PolymorphicSignature Object linkToInterface(Object... args) throws Throwable;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -695,7 +695,7 @@ abstract class MethodHandleImpl {
// Intrinsified by C2. Counters are used during parsing to calculate branch frequencies.
@Hidden
@jdk.internal.HotSpotIntrinsicCandidate
@jdk.internal.vm.annotation.IntrinsicCandidate
static boolean profileBoolean(boolean result, int[] counters) {
// Profile is int[2] where [0] and [1] correspond to false and true occurrences respectively.
int idx = result ? 1 : 0;
@ -710,7 +710,7 @@ abstract class MethodHandleImpl {
// Intrinsified by C2. Returns true if obj is a compile-time constant.
@Hidden
@jdk.internal.HotSpotIntrinsicCandidate
@jdk.internal.vm.annotation.IntrinsicCandidate
static boolean isCompileConstant(Object obj) {
return false;
}

View File

@ -39,9 +39,9 @@ import java.util.Optional;
import java.util.function.BiFunction;
import java.util.function.Function;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.util.Preconditions;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import jdk.internal.vm.annotation.Stable;
import static java.lang.invoke.MethodHandleStatics.UNSAFE;
@ -494,7 +494,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object get(Object... args);
/**
@ -520,7 +520,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
void set(Object... args);
@ -552,7 +552,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getVolatile(Object... args);
/**
@ -582,7 +582,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
void setVolatile(Object... args);
@ -612,7 +612,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getOpaque(Object... args);
/**
@ -639,7 +639,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
void setOpaque(Object... args);
@ -676,7 +676,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAcquire(Object... args);
/**
@ -707,7 +707,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
void setRelease(Object... args);
@ -743,7 +743,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
boolean compareAndSet(Object... args);
/**
@ -778,7 +778,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object compareAndExchange(Object... args);
/**
@ -813,7 +813,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object compareAndExchangeAcquire(Object... args);
/**
@ -848,7 +848,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object compareAndExchangeRelease(Object... args);
// Weak (spurious failures allowed)
@ -887,7 +887,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
boolean weakCompareAndSetPlain(Object... args);
/**
@ -924,7 +924,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
boolean weakCompareAndSet(Object... args);
/**
@ -962,7 +962,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
boolean weakCompareAndSetAcquire(Object... args);
/**
@ -1000,7 +1000,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
boolean weakCompareAndSetRelease(Object... args);
/**
@ -1033,7 +1033,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndSet(Object... args);
/**
@ -1066,7 +1066,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndSetAcquire(Object... args);
/**
@ -1099,7 +1099,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndSetRelease(Object... args);
// Primitive adders
@ -1135,7 +1135,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndAdd(Object... args);
/**
@ -1168,7 +1168,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndAddAcquire(Object... args);
/**
@ -1201,7 +1201,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndAddRelease(Object... args);
@ -1242,7 +1242,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndBitwiseOr(Object... args);
/**
@ -1279,7 +1279,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndBitwiseOrAcquire(Object... args);
/**
@ -1316,7 +1316,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndBitwiseOrRelease(Object... args);
/**
@ -1353,7 +1353,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndBitwiseAnd(Object... args);
/**
@ -1390,7 +1390,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndBitwiseAndAcquire(Object... args);
/**
@ -1427,7 +1427,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndBitwiseAndRelease(Object... args);
/**
@ -1464,7 +1464,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndBitwiseXor(Object... args);
/**
@ -1501,7 +1501,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndBitwiseXorAcquire(Object... args);
/**
@ -1538,7 +1538,7 @@ public abstract class VarHandle implements Constable {
*/
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
Object getAndBitwiseXorRelease(Object... args);

View File

@ -26,7 +26,7 @@
package java.lang.ref;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import jdk.internal.access.JavaLangRefAccess;
import jdk.internal.access.SharedSecrets;
import jdk.internal.ref.Cleaner;
@ -328,7 +328,7 @@ public abstract class Reference<T> {
* @return The object to which this reference refers, or
* {@code null} if this reference object has been cleared
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public T get() {
return this.referent;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,7 +25,7 @@
package java.lang.reflect;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* The {@code Array} class provides static methods to dynamically create and
@ -122,7 +122,7 @@ class Array {
* @throws IllegalArgumentException if the object argument is not
* an array
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native int getLength(Object array)
throws IllegalArgumentException;
@ -481,7 +481,7 @@ class Array {
* Private
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static native Object newArray(Class<?> componentType, int length)
throws NegativeArraySizeException;

View File

@ -25,12 +25,12 @@
package java.lang.reflect;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.access.SharedSecrets;
import jdk.internal.reflect.CallerSensitive;
import jdk.internal.reflect.MethodAccessor;
import jdk.internal.reflect.Reflection;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import sun.reflect.annotation.ExceptionProxy;
import sun.reflect.annotation.TypeNotPresentExceptionProxy;
import sun.reflect.generics.repository.MethodRepository;
@ -546,7 +546,7 @@ public final class Method extends Executable {
*/
@CallerSensitive
@ForceInline // to ensure Reflection.getCallerClass optimization
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public Object invoke(Object obj, Object... args)
throws IllegalAccessException, IllegalArgumentException,
InvocationTargetException

View File

@ -40,9 +40,9 @@ import java.util.concurrent.ThreadLocalRandom;
import jdk.internal.math.DoubleConsts;
import jdk.internal.math.FloatConsts;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.Stable;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import jdk.internal.vm.annotation.Stable;
/**
* Immutable arbitrary-precision integers. All operations behave as if
@ -1740,7 +1740,7 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
return implMultiplyToLen(x, xlen, y, ylen, z);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static int[] implMultiplyToLen(int[] x, int xlen, int[] y, int ylen, int[] z) {
int xstart = xlen - 1;
int ystart = ylen - 1;
@ -2133,7 +2133,7 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
/**
* Java Runtime may use intrinsic for this method.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static final int[] implSquareToLen(int[] x, int len, int[] z, int zlen) {
/*
* The algorithm used here is adapted from Colin Plumb's C library.
@ -2836,13 +2836,13 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
// These methods are intended to be replaced by virtual machine
// intrinsics.
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static int[] implMontgomeryMultiply(int[] a, int[] b, int[] n, int len,
long inv, int[] product) {
product = multiplyToLen(a, len, b, len, product);
return montReduce(product, n, len, (int)inv);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static int[] implMontgomerySquare(int[] a, int[] n, int len,
long inv, int[] product) {
product = squareToLen(a, len, product);
@ -3174,7 +3174,7 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
/**
* Java Runtime may use intrinsic for this method.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static int implMulAdd(int[] out, int[] in, int offset, int len, int k) {
long kLong = k & LONG_MASK;
long carry = 0;
@ -3355,7 +3355,7 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
}
@ForceInline
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static void shiftLeftImplWorker(int[] newArr, int[] oldArr, int newIdx, int shiftCount, int numIter) {
int shiftCountRight = 32 - shiftCount;
int oldIdx = 0;
@ -3440,7 +3440,7 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
}
@ForceInline
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static void shiftRightImplWorker(int[] newArr, int[] oldArr, int newIdx, int shiftCount, int numIter) {
int shiftCountLeft = 32 - shiftCount;
int idx = numIter;

View File

@ -25,7 +25,6 @@
package java.nio;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.access.JavaNioAccess;
import jdk.internal.access.SharedSecrets;
import jdk.internal.access.foreign.MemorySegmentProxy;
@ -33,6 +32,7 @@ import jdk.internal.access.foreign.UnmapperProxy;
import jdk.internal.misc.Unsafe;
import jdk.internal.misc.VM.BufferPool;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import java.io.FileDescriptor;
import java.util.Spliterator;
@ -732,7 +732,7 @@ public abstract class Buffer {
* IndexOutOfBoundsException} if it is not smaller than the limit
* or is smaller than zero.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
final int checkIndex(int i) { // package-private
if ((i < 0) || (i >= limit))
throw new IndexOutOfBoundsException();

View File

@ -25,8 +25,8 @@
package java.util;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.util.ArraysSupport;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import java.io.Serializable;
import java.lang.reflect.Array;
@ -2577,7 +2577,7 @@ public class Arrays {
* @param a2 the other array to be tested for equality
* @return {@code true} if the two arrays are equal
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static boolean equals(char[] a, char[] a2) {
if (a==a2)
return true;
@ -2650,7 +2650,7 @@ public class Arrays {
* @param a2 the other array to be tested for equality
* @return {@code true} if the two arrays are equal
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static boolean equals(byte[] a, byte[] a2) {
if (a==a2)
return true;
@ -3504,7 +3504,7 @@ public class Arrays {
* an array of class {@code newType}
* @since 1.6
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static <T,U> T[] copyOf(U[] original, int newLength, Class<? extends T[]> newType) {
@SuppressWarnings("unchecked")
T[] copy = ((Object)newType == (Object)Object[].class)
@ -3774,7 +3774,7 @@ public class Arrays {
* an array of class {@code newType}.
* @since 1.6
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static <T,U> T[] copyOfRange(U[] original, int from, int to, Class<? extends T[]> newType) {
int newLength = to - from;
if (newLength < 0)

View File

@ -33,7 +33,7 @@ import java.nio.ByteBuffer;
import sun.nio.cs.ISO_8859_1;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* This class consists exclusively of static methods for obtaining
@ -418,7 +418,7 @@ public class Base64 {
return new Encoder(isURL, newline, linemax, false);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private void encodeBlock(byte[] src, int sp, int sl, byte[] dst, int dp, boolean isURL) {
char[] base64 = isURL ? toBase64URL : toBase64;
for (int sp0 = sp, dp0 = dp ; sp0 < sl; ) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -31,7 +31,7 @@ import java.util.function.Consumer;
import java.util.function.DoubleConsumer;
import java.util.function.IntConsumer;
import java.util.function.LongConsumer;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* Utility methods for operating on and creating streams.
@ -91,7 +91,7 @@ final class Streams {
}
@Override
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public void forEachRemaining(IntConsumer consumer) {
Objects.requireNonNull(consumer);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,7 @@ package java.util.zip;
import java.nio.ByteBuffer;
import sun.nio.ch.DirectBuffer;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* A class that can be used to compute the Adler-32 checksum of a data
@ -129,10 +129,10 @@ public class Adler32 implements Checksum {
private static native int update(int adler, int b);
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static native int updateBytes(int adler, byte[] b, int off,
int len);
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static native int updateByteBuffer(int adler, long addr,
int off, int len);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,7 +29,7 @@ import java.nio.ByteBuffer;
import java.util.Objects;
import sun.nio.ch.DirectBuffer;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* A class that can be used to compute the CRC-32 of a data stream.
@ -126,7 +126,7 @@ public class CRC32 implements Checksum {
return (long)crc & 0xffffffffL;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static native int update(int crc, int b);
private static int updateBytes(int crc, byte[] b, int off, int len) {
@ -134,7 +134,7 @@ public class CRC32 implements Checksum {
return updateBytes0(crc, b, off, len);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static native int updateBytes0(int crc, byte[] b, int off, int len);
private static void updateBytesCheck(byte[] b, int off, int len) {
@ -160,7 +160,7 @@ public class CRC32 implements Checksum {
return updateByteBuffer0(alder, addr, off, len);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static native int updateByteBuffer0(int alder, long addr,
int off, int len);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,8 +27,8 @@ package java.util.zip;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.Unsafe;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import sun.nio.ch.DirectBuffer;
/**
@ -206,7 +206,7 @@ public final class CRC32C implements Checksum {
/**
* Updates the CRC-32C checksum with the specified array of bytes.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static int updateBytes(int crc, byte[] b, int off, int end) {
// Do only byte reads for arrays so short they can't be aligned
@ -281,7 +281,7 @@ public final class CRC32C implements Checksum {
/**
* Updates the CRC-32C checksum reading from the specified address.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static int updateDirectByteBuffer(int crc, long address,
int off, int end) {

View File

@ -25,9 +25,9 @@
package jdk.internal.misc;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.ref.Cleaner;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import sun.nio.ch.DirectBuffer;
import java.lang.reflect.Field;
@ -151,7 +151,7 @@ public final class Unsafe {
* @throws RuntimeException No defined exceptions are thrown, not even
* {@link NullPointerException}
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native int getInt(Object o, long offset);
/**
@ -174,14 +174,14 @@ public final class Unsafe {
* @throws RuntimeException No defined exceptions are thrown, not even
* {@link NullPointerException}
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putInt(Object o, long offset, int x);
/**
* Fetches a reference value from a given Java variable.
* @see #getInt(Object, long)
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native Object getReference(Object o, long offset);
/**
@ -194,63 +194,63 @@ public final class Unsafe {
* are updated.
* @see #putInt(Object, long, int)
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putReference(Object o, long offset, Object x);
/** @see #getInt(Object, long) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native boolean getBoolean(Object o, long offset);
/** @see #putInt(Object, long, int) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putBoolean(Object o, long offset, boolean x);
/** @see #getInt(Object, long) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native byte getByte(Object o, long offset);
/** @see #putInt(Object, long, int) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putByte(Object o, long offset, byte x);
/** @see #getInt(Object, long) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native short getShort(Object o, long offset);
/** @see #putInt(Object, long, int) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putShort(Object o, long offset, short x);
/** @see #getInt(Object, long) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native char getChar(Object o, long offset);
/** @see #putInt(Object, long, int) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putChar(Object o, long offset, char x);
/** @see #getInt(Object, long) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native long getLong(Object o, long offset);
/** @see #putInt(Object, long, int) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putLong(Object o, long offset, long x);
/** @see #getInt(Object, long) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native float getFloat(Object o, long offset);
/** @see #putInt(Object, long, int) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putFloat(Object o, long offset, float x);
/** @see #getInt(Object, long) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native double getDouble(Object o, long offset);
/** @see #putInt(Object, long, int) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putDouble(Object o, long offset, double x);
/**
@ -1016,19 +1016,19 @@ public final class Unsafe {
* @param address
* the start address of the cache line to be written back
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private native void writeback0(long address);
/**
* Serialize writeback operations relative to preceding memory writes.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private native void writebackPreSync0();
/**
* Serialize writeback operations relative to following memory writes.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private native void writebackPostSync0();
/// random queries
@ -1360,7 +1360,7 @@ public final class Unsafe {
* Allocates an instance but does not run any constructor.
* Initializes the class if it has not yet been.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native Object allocateInstance(Class<?> cls)
throws InstantiationException;
@ -1402,7 +1402,7 @@ public final class Unsafe {
return allocateUninitializedArray0(componentType, length);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private Object allocateUninitializedArray0(Class<?> componentType, int length) {
// These fallbacks provide zeroed arrays, but intrinsic is not required to
// return the zeroed arrays.
@ -1429,52 +1429,52 @@ public final class Unsafe {
*
* @return {@code true} if successful
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native boolean compareAndSetReference(Object o, long offset,
Object expected,
Object x);
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native Object compareAndExchangeReference(Object o, long offset,
Object expected,
Object x);
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final Object compareAndExchangeReferenceAcquire(Object o, long offset,
Object expected,
Object x) {
return compareAndExchangeReference(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final Object compareAndExchangeReferenceRelease(Object o, long offset,
Object expected,
Object x) {
return compareAndExchangeReference(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetReferencePlain(Object o, long offset,
Object expected,
Object x) {
return compareAndSetReference(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetReferenceAcquire(Object o, long offset,
Object expected,
Object x) {
return compareAndSetReference(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetReferenceRelease(Object o, long offset,
Object expected,
Object x) {
return compareAndSetReference(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetReference(Object o, long offset,
Object expected,
Object x) {
@ -1490,59 +1490,59 @@ public final class Unsafe {
*
* @return {@code true} if successful
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native boolean compareAndSetInt(Object o, long offset,
int expected,
int x);
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native int compareAndExchangeInt(Object o, long offset,
int expected,
int x);
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final int compareAndExchangeIntAcquire(Object o, long offset,
int expected,
int x) {
return compareAndExchangeInt(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final int compareAndExchangeIntRelease(Object o, long offset,
int expected,
int x) {
return compareAndExchangeInt(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetIntPlain(Object o, long offset,
int expected,
int x) {
return compareAndSetInt(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetIntAcquire(Object o, long offset,
int expected,
int x) {
return compareAndSetInt(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetIntRelease(Object o, long offset,
int expected,
int x) {
return compareAndSetInt(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetInt(Object o, long offset,
int expected,
int x) {
return compareAndSetInt(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final byte compareAndExchangeByte(Object o, long offset,
byte expected,
byte x) {
@ -1564,56 +1564,56 @@ public final class Unsafe {
return expected;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean compareAndSetByte(Object o, long offset,
byte expected,
byte x) {
return compareAndExchangeByte(o, offset, expected, x) == expected;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetByte(Object o, long offset,
byte expected,
byte x) {
return compareAndSetByte(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetByteAcquire(Object o, long offset,
byte expected,
byte x) {
return weakCompareAndSetByte(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetByteRelease(Object o, long offset,
byte expected,
byte x) {
return weakCompareAndSetByte(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetBytePlain(Object o, long offset,
byte expected,
byte x) {
return weakCompareAndSetByte(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final byte compareAndExchangeByteAcquire(Object o, long offset,
byte expected,
byte x) {
return compareAndExchangeByte(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final byte compareAndExchangeByteRelease(Object o, long offset,
byte expected,
byte x) {
return compareAndExchangeByte(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final short compareAndExchangeShort(Object o, long offset,
short expected,
short x) {
@ -1639,35 +1639,35 @@ public final class Unsafe {
return expected;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean compareAndSetShort(Object o, long offset,
short expected,
short x) {
return compareAndExchangeShort(o, offset, expected, x) == expected;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetShort(Object o, long offset,
short expected,
short x) {
return compareAndSetShort(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetShortAcquire(Object o, long offset,
short expected,
short x) {
return weakCompareAndSetShort(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetShortRelease(Object o, long offset,
short expected,
short x) {
return weakCompareAndSetShort(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetShortPlain(Object o, long offset,
short expected,
short x) {
@ -1675,14 +1675,14 @@ public final class Unsafe {
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final short compareAndExchangeShortAcquire(Object o, long offset,
short expected,
short x) {
return compareAndExchangeShort(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final short compareAndExchangeShortRelease(Object o, long offset,
short expected,
short x) {
@ -2037,52 +2037,52 @@ public final class Unsafe {
*
* @return {@code true} if successful
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native boolean compareAndSetLong(Object o, long offset,
long expected,
long x);
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native long compareAndExchangeLong(Object o, long offset,
long expected,
long x);
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final long compareAndExchangeLongAcquire(Object o, long offset,
long expected,
long x) {
return compareAndExchangeLong(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final long compareAndExchangeLongRelease(Object o, long offset,
long expected,
long x) {
return compareAndExchangeLong(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetLongPlain(Object o, long offset,
long expected,
long x) {
return compareAndSetLong(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetLongAcquire(Object o, long offset,
long expected,
long x) {
return compareAndSetLong(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetLongRelease(Object o, long offset,
long expected,
long x) {
return compareAndSetLong(o, offset, expected, x);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean weakCompareAndSetLong(Object o, long offset,
long expected,
long x) {
@ -2093,132 +2093,132 @@ public final class Unsafe {
* Fetches a reference value from a given Java variable, with volatile
* load semantics. Otherwise identical to {@link #getReference(Object, long)}
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native Object getReferenceVolatile(Object o, long offset);
/**
* Stores a reference value into a given Java variable, with
* volatile store semantics. Otherwise identical to {@link #putReference(Object, long, Object)}
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putReferenceVolatile(Object o, long offset, Object x);
/** Volatile version of {@link #getInt(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native int getIntVolatile(Object o, long offset);
/** Volatile version of {@link #putInt(Object, long, int)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putIntVolatile(Object o, long offset, int x);
/** Volatile version of {@link #getBoolean(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native boolean getBooleanVolatile(Object o, long offset);
/** Volatile version of {@link #putBoolean(Object, long, boolean)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putBooleanVolatile(Object o, long offset, boolean x);
/** Volatile version of {@link #getByte(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native byte getByteVolatile(Object o, long offset);
/** Volatile version of {@link #putByte(Object, long, byte)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putByteVolatile(Object o, long offset, byte x);
/** Volatile version of {@link #getShort(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native short getShortVolatile(Object o, long offset);
/** Volatile version of {@link #putShort(Object, long, short)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putShortVolatile(Object o, long offset, short x);
/** Volatile version of {@link #getChar(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native char getCharVolatile(Object o, long offset);
/** Volatile version of {@link #putChar(Object, long, char)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putCharVolatile(Object o, long offset, char x);
/** Volatile version of {@link #getLong(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native long getLongVolatile(Object o, long offset);
/** Volatile version of {@link #putLong(Object, long, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putLongVolatile(Object o, long offset, long x);
/** Volatile version of {@link #getFloat(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native float getFloatVolatile(Object o, long offset);
/** Volatile version of {@link #putFloat(Object, long, float)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putFloatVolatile(Object o, long offset, float x);
/** Volatile version of {@link #getDouble(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native double getDoubleVolatile(Object o, long offset);
/** Volatile version of {@link #putDouble(Object, long, double)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void putDoubleVolatile(Object o, long offset, double x);
/** Acquire version of {@link #getReferenceVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final Object getReferenceAcquire(Object o, long offset) {
return getReferenceVolatile(o, offset);
}
/** Acquire version of {@link #getBooleanVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean getBooleanAcquire(Object o, long offset) {
return getBooleanVolatile(o, offset);
}
/** Acquire version of {@link #getByteVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final byte getByteAcquire(Object o, long offset) {
return getByteVolatile(o, offset);
}
/** Acquire version of {@link #getShortVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final short getShortAcquire(Object o, long offset) {
return getShortVolatile(o, offset);
}
/** Acquire version of {@link #getCharVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final char getCharAcquire(Object o, long offset) {
return getCharVolatile(o, offset);
}
/** Acquire version of {@link #getIntVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final int getIntAcquire(Object o, long offset) {
return getIntVolatile(o, offset);
}
/** Acquire version of {@link #getFloatVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final float getFloatAcquire(Object o, long offset) {
return getFloatVolatile(o, offset);
}
/** Acquire version of {@link #getLongVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final long getLongAcquire(Object o, long offset) {
return getLongVolatile(o, offset);
}
/** Acquire version of {@link #getDoubleVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final double getDoubleAcquire(Object o, long offset) {
return getDoubleVolatile(o, offset);
}
@ -2234,55 +2234,55 @@ public final class Unsafe {
*/
/** Release version of {@link #putReferenceVolatile(Object, long, Object)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putReferenceRelease(Object o, long offset, Object x) {
putReferenceVolatile(o, offset, x);
}
/** Release version of {@link #putBooleanVolatile(Object, long, boolean)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putBooleanRelease(Object o, long offset, boolean x) {
putBooleanVolatile(o, offset, x);
}
/** Release version of {@link #putByteVolatile(Object, long, byte)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putByteRelease(Object o, long offset, byte x) {
putByteVolatile(o, offset, x);
}
/** Release version of {@link #putShortVolatile(Object, long, short)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putShortRelease(Object o, long offset, short x) {
putShortVolatile(o, offset, x);
}
/** Release version of {@link #putCharVolatile(Object, long, char)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putCharRelease(Object o, long offset, char x) {
putCharVolatile(o, offset, x);
}
/** Release version of {@link #putIntVolatile(Object, long, int)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putIntRelease(Object o, long offset, int x) {
putIntVolatile(o, offset, x);
}
/** Release version of {@link #putFloatVolatile(Object, long, float)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putFloatRelease(Object o, long offset, float x) {
putFloatVolatile(o, offset, x);
}
/** Release version of {@link #putLongVolatile(Object, long, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putLongRelease(Object o, long offset, long x) {
putLongVolatile(o, offset, x);
}
/** Release version of {@link #putDoubleVolatile(Object, long, double)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putDoubleRelease(Object o, long offset, double x) {
putDoubleVolatile(o, offset, x);
}
@ -2290,109 +2290,109 @@ public final class Unsafe {
// ------------------------------ Opaque --------------------------------------
/** Opaque version of {@link #getReferenceVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final Object getReferenceOpaque(Object o, long offset) {
return getReferenceVolatile(o, offset);
}
/** Opaque version of {@link #getBooleanVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final boolean getBooleanOpaque(Object o, long offset) {
return getBooleanVolatile(o, offset);
}
/** Opaque version of {@link #getByteVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final byte getByteOpaque(Object o, long offset) {
return getByteVolatile(o, offset);
}
/** Opaque version of {@link #getShortVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final short getShortOpaque(Object o, long offset) {
return getShortVolatile(o, offset);
}
/** Opaque version of {@link #getCharVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final char getCharOpaque(Object o, long offset) {
return getCharVolatile(o, offset);
}
/** Opaque version of {@link #getIntVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final int getIntOpaque(Object o, long offset) {
return getIntVolatile(o, offset);
}
/** Opaque version of {@link #getFloatVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final float getFloatOpaque(Object o, long offset) {
return getFloatVolatile(o, offset);
}
/** Opaque version of {@link #getLongVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final long getLongOpaque(Object o, long offset) {
return getLongVolatile(o, offset);
}
/** Opaque version of {@link #getDoubleVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final double getDoubleOpaque(Object o, long offset) {
return getDoubleVolatile(o, offset);
}
/** Opaque version of {@link #putReferenceVolatile(Object, long, Object)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putReferenceOpaque(Object o, long offset, Object x) {
putReferenceVolatile(o, offset, x);
}
/** Opaque version of {@link #putBooleanVolatile(Object, long, boolean)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putBooleanOpaque(Object o, long offset, boolean x) {
putBooleanVolatile(o, offset, x);
}
/** Opaque version of {@link #putByteVolatile(Object, long, byte)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putByteOpaque(Object o, long offset, byte x) {
putByteVolatile(o, offset, x);
}
/** Opaque version of {@link #putShortVolatile(Object, long, short)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putShortOpaque(Object o, long offset, short x) {
putShortVolatile(o, offset, x);
}
/** Opaque version of {@link #putCharVolatile(Object, long, char)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putCharOpaque(Object o, long offset, char x) {
putCharVolatile(o, offset, x);
}
/** Opaque version of {@link #putIntVolatile(Object, long, int)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putIntOpaque(Object o, long offset, int x) {
putIntVolatile(o, offset, x);
}
/** Opaque version of {@link #putFloatVolatile(Object, long, float)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putFloatOpaque(Object o, long offset, float x) {
putFloatVolatile(o, offset, x);
}
/** Opaque version of {@link #putLongVolatile(Object, long, long)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putLongOpaque(Object o, long offset, long x) {
putLongVolatile(o, offset, x);
}
/** Opaque version of {@link #putDoubleVolatile(Object, long, double)} */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putDoubleOpaque(Object o, long offset, double x) {
putDoubleVolatile(o, offset, x);
}
@ -2409,7 +2409,7 @@ public final class Unsafe {
*
* @param thread the thread to unpark.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void unpark(Object thread);
/**
@ -2423,7 +2423,7 @@ public final class Unsafe {
* because {@code unpark} is, so it would be strange to place it
* elsewhere.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void park(boolean isAbsolute, long time);
/**
@ -2463,7 +2463,7 @@ public final class Unsafe {
* @return the previous value
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final int getAndAddInt(Object o, long offset, int delta) {
int v;
do {
@ -2501,7 +2501,7 @@ public final class Unsafe {
* @return the previous value
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final long getAndAddLong(Object o, long offset, long delta) {
long v;
do {
@ -2528,7 +2528,7 @@ public final class Unsafe {
return v;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final byte getAndAddByte(Object o, long offset, byte delta) {
byte v;
do {
@ -2555,7 +2555,7 @@ public final class Unsafe {
return v;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final short getAndAddShort(Object o, long offset, short delta) {
short v;
do {
@ -2698,7 +2698,7 @@ public final class Unsafe {
* @return the previous value
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final int getAndSetInt(Object o, long offset, int newValue) {
int v;
do {
@ -2736,7 +2736,7 @@ public final class Unsafe {
* @return the previous value
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final long getAndSetLong(Object o, long offset, long newValue) {
long v;
do {
@ -2774,7 +2774,7 @@ public final class Unsafe {
* @return the previous value
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final Object getAndSetReference(Object o, long offset, Object newValue) {
Object v;
do {
@ -2801,7 +2801,7 @@ public final class Unsafe {
return v;
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final byte getAndSetByte(Object o, long offset, byte newValue) {
byte v;
do {
@ -2843,7 +2843,7 @@ public final class Unsafe {
return byte2bool(getAndSetByteAcquire(o, offset, bool2byte(newValue)));
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final short getAndSetShort(Object o, long offset, short newValue) {
short v;
do {
@ -3416,7 +3416,7 @@ public final class Unsafe {
*
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void loadFence();
/**
@ -3431,7 +3431,7 @@ public final class Unsafe {
*
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void storeFence();
/**
@ -3443,7 +3443,7 @@ public final class Unsafe {
* Corresponds to C11 atomic_thread_fence(memory_order_seq_cst).
* @since 1.8
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native void fullFence();
/**
@ -3536,7 +3536,7 @@ public final class Unsafe {
* {@link NullPointerException}
* @since 9
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final long getLongUnaligned(Object o, long offset) {
if ((offset & 7) == 0) {
return getLong(o, offset);
@ -3575,7 +3575,7 @@ public final class Unsafe {
}
/** @see #getLongUnaligned(Object, long) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final int getIntUnaligned(Object o, long offset) {
if ((offset & 3) == 0) {
return getInt(o, offset);
@ -3595,7 +3595,7 @@ public final class Unsafe {
}
/** @see #getLongUnaligned(Object, long) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final short getShortUnaligned(Object o, long offset) {
if ((offset & 1) == 0) {
return getShort(o, offset);
@ -3610,7 +3610,7 @@ public final class Unsafe {
}
/** @see #getLongUnaligned(Object, long) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final char getCharUnaligned(Object o, long offset) {
if ((offset & 1) == 0) {
return getChar(o, offset);
@ -3653,7 +3653,7 @@ public final class Unsafe {
* {@link NullPointerException}
* @since 9
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putLongUnaligned(Object o, long offset, long x) {
if ((offset & 7) == 0) {
putLong(o, offset, x);
@ -3696,7 +3696,7 @@ public final class Unsafe {
}
/** @see #putLongUnaligned(Object, long, long) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putIntUnaligned(Object o, long offset, int x) {
if ((offset & 3) == 0) {
putInt(o, offset, x);
@ -3718,7 +3718,7 @@ public final class Unsafe {
}
/** @see #putLongUnaligned(Object, long, long) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putShortUnaligned(Object o, long offset, short x) {
if ((offset & 1) == 0) {
putShort(o, offset, x);
@ -3734,7 +3734,7 @@ public final class Unsafe {
}
/** @see #putLongUnaligned(Object, long, long) */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final void putCharUnaligned(Object o, long offset, char x) {
putShortUnaligned(o, offset, (short)x);
}
@ -3843,7 +3843,7 @@ public final class Unsafe {
private native long reallocateMemory0(long address, long bytes);
private native void freeMemory0(long address);
private native void setMemory0(Object o, long offset, long bytes, byte value);
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private native void copyMemory0(Object srcBase, long srcOffset, Object destBase, long destOffset, long bytes);
private native void copySwapMemory0(Object srcBase, long srcOffset, Object destBase, long destOffset, long bytes, long elemSize);
private native long objectFieldOffset0(Field f);

View File

@ -30,9 +30,9 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.access.SharedSecrets;
import jdk.internal.misc.VM;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/** Common utility routines used by both java.lang and
java.lang.reflect */
@ -67,7 +67,7 @@ public class Reflection {
ignoring frames associated with java.lang.reflect.Method.invoke()
and its implementation. */
@CallerSensitive
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native Class<?> getCallerClass();
/** Retrieves the access flags written to the class file. For
@ -78,7 +78,7 @@ public class Reflection {
to compatibility reasons; see 4471811. Only the values of the
low 13 bits (i.e., a mask of 0x1FFF) are guaranteed to be
valid. */
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native int getClassAccessFlags(Class<?> c);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -24,8 +24,8 @@
*/
package jdk.internal.util;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.Unsafe;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* Utility methods to work with arrays. This includes a set of methods
@ -108,7 +108,7 @@ public class ArraysSupport {
* compliment of the number of remaining pairs of elements to be checked in
* the tail of the two arrays.
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static int vectorizedMismatch(Object a, long aOffset,
Object b, long bOffset,
int length,

View File

@ -24,7 +24,7 @@
*/
package jdk.internal.util;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import java.util.List;
import java.util.function.BiFunction;
@ -240,7 +240,7 @@ public class Preconditions {
* length is a non-negative value (such as that of an array length or from
* the upper bound of a loop)
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static <X extends RuntimeException>
int checkIndex(int index, int length,
BiFunction<String, List<Integer>, X> oobef) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,25 +23,25 @@
* questions.
*/
package jdk.internal;
package jdk.internal.vm.annotation;
import java.lang.annotation.*;
/**
* The {@code @HotSpotIntrinsicCandidate} annotation is specific to the
* The {@code @IntrinsicCandidate} annotation is specific to the
* HotSpot Virtual Machine. It indicates that an annotated method
* may be (but is not guaranteed to be) intrinsified by the HotSpot VM. A method
* is intrinsified if the HotSpot VM replaces the annotated method with hand-written
* assembly and/or hand-written compiler IR -- a compiler intrinsic -- to improve
* performance. The {@code @HotSpotIntrinsicCandidate} annotation is internal to the
* performance. The {@code @IntrinsicCandidate} annotation is internal to the
* Java libraries and is therefore not supposed to have any relevance for application
* code.
*
* Maintainers of the Java libraries must consider the following when
* modifying methods annotated with {@code @HotSpotIntrinsicCandidate}.
* modifying methods annotated with {@code @IntrinsicCandidate}.
*
* <ul>
* <li>When modifying a method annotated with {@code @HotSpotIntrinsicCandidate},
* <li>When modifying a method annotated with {@code @IntrinsicCandidate},
* the corresponding intrinsic code in the HotSpot VM implementation must be
* updated to match the semantics of the annotated method.</li>
* <li>For some annotated methods, the corresponding intrinsic may omit some low-level
@ -92,7 +92,7 @@ import java.lang.annotation.*;
*
* <ul>
* <li>When adding a new intrinsic, make sure that the corresponding method
* in the Java libraries is annotated with {@code @HotSpotIntrinsicCandidate}
* in the Java libraries is annotated with {@code @IntrinsicCandidate}
* and that all possible call sequences that result in calling the intrinsic contain
* the checks omitted by the intrinsic (if any).</li>
* <li>When modifying an existing intrinsic, the Java libraries must be updated
@ -102,24 +102,24 @@ import java.lang.annotation.*;
*
* Persons not directly involved with maintaining the Java libraries or the
* HotSpot VM can safely ignore the fact that a method is annotated with
* {@code @HotSpotIntrinsicCandidate}.
* {@code @IntrinsicCandidate}.
*
* The HotSpot VM defines (internally) a list of intrinsics. Not all intrinsic
* are available on all platforms supported by the HotSpot VM. Furthermore,
* the availability of an intrinsic on a given platform depends on the
* configuration of the HotSpot VM (e.g., the set of VM flags enabled).
* Therefore, annotating a method with {@code @HotSpotIntrinsicCandidate} does
* Therefore, annotating a method with {@code @IntrinsicCandidate} does
* not guarantee that the marked method is intrinsified by the HotSpot VM.
*
* If the {@code CheckIntrinsics} VM flag is enabled, the HotSpot VM checks
* (when loading a class) that (1) all methods of that class that are also on
* the VM's list of intrinsics are annotated with {@code @HotSpotIntrinsicCandidate}
* the VM's list of intrinsics are annotated with {@code @IntrinsicCandidate}
* and that (2) for all methods of that class annotated with
* {@code @HotSpotIntrinsicCandidate} there is an intrinsic in the list.
* {@code @IntrinsicCandidate} there is an intrinsic in the list.
*
* @since 9
* @since 16
*/
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.RUNTIME)
public @interface HotSpotIntrinsicCandidate {
public @interface IntrinsicCandidate {
}

View File

@ -140,7 +140,6 @@ module java.base {
java.security.sasl;
exports jdk.internal to
java.compiler,
jdk.jfr,
jdk.compiler,
jdk.jshell;
exports jdk.internal.access to
@ -230,6 +229,7 @@ module java.base {
exports jdk.internal.vm.annotation to
jdk.internal.vm.ci,
jdk.incubator.foreign,
jdk.jfr,
jdk.unsupported;
exports jdk.internal.util to
jdk.incubator.foreign;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -33,7 +33,7 @@ import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import java.util.Objects;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
public class ISO_8859_1
extends Charset
@ -151,7 +151,7 @@ public class ISO_8859_1
return implEncodeISOArray(sa, sp, da, dp, len);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private static int implEncodeISOArray(char[] sa, int sp,
byte[] da, int dp, int len)
{

View File

@ -31,7 +31,7 @@ import java.security.ProviderException;
import java.util.Arrays;
import java.util.Objects;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* Common base message digest implementation for the Sun provider.
@ -144,7 +144,7 @@ abstract class DigestBase extends MessageDigestSpi implements Cloneable {
return implCompressMultiBlock0(b, ofs, limit);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private int implCompressMultiBlock0(byte[] b, int ofs, int limit) {
for (; ofs <= limit; ofs += blockSize) {
implCompress(b, ofs);

View File

@ -29,7 +29,7 @@ import java.util.Arrays;
import java.util.Objects;
import static sun.security.provider.ByteArrayAccess.*;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* The MD5 class is used to compute an MD5 message digest over a given
@ -168,7 +168,7 @@ public final class MD5 extends DigestBase {
// that operates directly on the array 'buf' (starting from
// offset 'ofs') and not on array 'x', therefore 'buf' and 'ofs'
// must be passed as parameter to the method.
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
void implCompress0(byte[] buf, int ofs) {
int a = state[0];
int b = state[1];

View File

@ -29,7 +29,7 @@ import java.util.Arrays;
import java.util.Objects;
import static sun.security.provider.ByteArrayAccess.*;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* This class implements the Secure Hash Algorithm (SHA) developed by
@ -144,7 +144,7 @@ public final class SHA extends DigestBase {
// that operates directly on the array 'buf' (starting from
// offset 'ofs') and not on array 'W', therefore 'buf' and 'ofs'
// must be passed as parameter to the method.
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private void implCompress0(byte[] buf, int ofs) {
// The first 16 ints have the byte stream, compute the rest of
// the buffer

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,7 @@ package sun.security.provider;
import java.util.Arrays;
import java.util.Objects;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import static sun.security.provider.ByteArrayAccess.*;
/**
@ -214,7 +214,7 @@ abstract class SHA2 extends DigestBase {
// that operates directly on the array 'buf' (starting from
// offset 'ofs') and not on array 'W', therefore 'buf' and 'ofs'
// must be passed as parameter to the method.
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private void implCompress0(byte[] buf, int ofs) {
// The first 16 ints are from the byte stream, compute the rest of
// the W[]'s

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,7 @@ package sun.security.provider;
import java.util.Arrays;
import java.util.Objects;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import static sun.security.provider.ByteArrayAccess.*;
/**
@ -237,7 +237,7 @@ abstract class SHA5 extends DigestBase {
// that operates directly on the array 'buf' (starting from
// offset 'ofs') and not on array 'W', therefore 'buf' and 'ofs'
// must be passed as parameter to the method.
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
private final void implCompress0(byte[] buf, int ofs) {
// The first 16 longs are from the byte stream, compute the rest of
// the W[]'s

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -109,8 +109,8 @@ public interface HotSpotResolvedJavaMethod extends ResolvedJavaMethod {
/**
* Determines if this method denotes itself as a candidate for intrinsification. As of JDK 9,
* this is denoted by the {@code HotSpotIntrinsicCandidate} annotation. In earlier JDK versions,
* this method returns true.
* this is denoted by the {@code IntrinsicCandidate} annotation. In earlier JDK versions, this
* method returns true.
*
* @see <a href="https://bugs.openjdk.java.net/browse/JDK-8076112">JDK-8076112</a>
*/

View File

@ -150,7 +150,7 @@ public class AMD64StringLatin1Substitutions {
* Intrinsic for {@code java.lang.StringLatin1.inflate([BI[CII)V}.
*
* <pre>
* &#64;HotSpotIntrinsicCandidate
* &#64;IntrinsicCandidate
* public static void inflate(byte[] src, int src_indx, char[] dst, int dst_indx, int len)
* </pre>
*/
@ -174,7 +174,7 @@ public class AMD64StringLatin1Substitutions {
* Intrinsic for {@code }java.lang.StringLatin1.inflate([BI[BII)V}.
*
* <pre>
* &#64;HotSpotIntrinsicCandidate
* &#64;IntrinsicCandidate
* public static void inflate(byte[] src, int src_indx, byte[] dst, int dst_indx, int len)
* </pre>
*

View File

@ -171,7 +171,7 @@ public class AMD64StringUTF16Substitutions {
* Intrinsic for {@code java.lang.StringUTF16.compress([CI[BII)I}.
*
* <pre>
* &#64;HotSpotIntrinsicCandidate
* &#64;IntrinsicCandidate
* public static int compress(char[] src, int src_indx, byte[] dst, int dst_indx, int len)
* </pre>
*/
@ -188,7 +188,7 @@ public class AMD64StringUTF16Substitutions {
* Intrinsic for {@code }java.lang.StringUTF16.compress([BI[BII)I}.
*
* <pre>
* &#64;HotSpotIntrinsicCandidate
* &#64;IntrinsicCandidate
* public static int compress(byte[] src, int src_indx, byte[] dst, int dst_indx, int len)
* </pre>
* <p>

View File

@ -27,7 +27,7 @@ package jdk.jfr.internal;
import java.util.List;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import jdk.jfr.Event;
import jdk.jfr.internal.handlers.EventHandler;
@ -102,7 +102,7 @@ public final class JVM {
* @return the time, in ticks
*
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native long counterTime();
/**
@ -139,7 +139,7 @@ public final class JVM {
*
* @return a unique class identifier
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native long getClassId(Class<?> clazz);
// temporary workaround until we solve intrinsics supporting epoch shift tagging
@ -438,7 +438,7 @@ public final class JVM {
*
* @return thread local EventWriter
*/
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public static native Object getEventWriter();
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
package java.lang;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* Slightly modified version of java.lang.Object that replaces
@ -31,30 +31,30 @@ import jdk.internal.HotSpotIntrinsicCandidate;
*/
public class Object {
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public Object() {}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native Class<?> getClass();
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public native int hashCode();
public boolean equals(Object obj) {
return (this == obj);
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
protected native Object clone() throws CloneNotSupportedException;
public String toString() {
return getClass().getName() + "@" + Integer.toHexString(hashCode());
}
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native void notify();
@HotSpotIntrinsicCandidate
@IntrinsicCandidate
public final native void notifyAll();
public final native void wait(long timeout) throws InterruptedException;

View File

@ -111,7 +111,7 @@ public final class TestModuleEvents {
assertEquals(edges.get("jdk/jfr"), UNNAMED);
assertEquals(edges.get("java/util"), UNNAMED);
assertEquals(edges.get("jdk/jfr/events"), "java.base");
assertEquals(edges.get("jdk/internal"), "jdk.jfr");
assertEquals(edges.get("jdk/internal/vm/annotation"), "jdk.jfr");
recording.close();
}