mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8076112: Add @HotSpotIntrinsicCandidate annotation to indicate methods for which Java Runtime has intrinsics
Annotate possibly intrinsified methods with @HotSpotIntrinsicCandidate. Add checks omitted by intrinsics to the library code. Add CheckIntrinsics flags to check consistency of intrinsics. Reviewed-by: jrose, kvn, thartmann, vlivanov, abuckley, darcy, ascarpino, briangoetz, alanb, aph, dnsimon
This commit is contained in:
parent
ea0323cf1a
commit
94d36649af
41 changed files with 667 additions and 30 deletions
|
@ -28,6 +28,7 @@ package java.lang;
|
|||
import sun.misc.FloatingDecimal;
|
||||
import sun.misc.FloatConsts;
|
||||
import sun.misc.DoubleConsts;
|
||||
import jdk.internal.HotSpotIntrinsicCandidate;
|
||||
|
||||
/**
|
||||
* The {@code Float} class wraps a value of primitive type
|
||||
|
@ -429,6 +430,7 @@ public final class Float extends Number implements Comparable<Float> {
|
|||
* @return a {@code Float} instance representing {@code f}.
|
||||
* @since 1.5
|
||||
*/
|
||||
@HotSpotIntrinsicCandidate
|
||||
public static Float valueOf(float f) {
|
||||
return new Float(f);
|
||||
}
|
||||
|
@ -622,6 +624,7 @@ public final class Float extends Number implements Comparable<Float> {
|
|||
*
|
||||
* @return the {@code float} value represented by this object
|
||||
*/
|
||||
@HotSpotIntrinsicCandidate
|
||||
public float floatValue() {
|
||||
return value;
|
||||
}
|
||||
|
@ -740,6 +743,7 @@ public final class Float extends Number implements Comparable<Float> {
|
|||
* @param value a floating-point number.
|
||||
* @return the bits that represent the floating-point number.
|
||||
*/
|
||||
@HotSpotIntrinsicCandidate
|
||||
public static int floatToIntBits(float value) {
|
||||
if (!isNaN(value)) {
|
||||
return floatToRawIntBits(value);
|
||||
|
@ -782,6 +786,7 @@ public final class Float extends Number implements Comparable<Float> {
|
|||
* @return the bits that represent the floating-point number.
|
||||
* @since 1.3
|
||||
*/
|
||||
@HotSpotIntrinsicCandidate
|
||||
public static native int floatToRawIntBits(float value);
|
||||
|
||||
/**
|
||||
|
@ -843,6 +848,7 @@ public final class Float extends Number implements Comparable<Float> {
|
|||
* @return the {@code float} floating-point value with the same bit
|
||||
* pattern.
|
||||
*/
|
||||
@HotSpotIntrinsicCandidate
|
||||
public static native float intBitsToFloat(int bits);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue