mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
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:
parent
4b16f8ab94
commit
2a406f3ce5
64 changed files with 488 additions and 488 deletions
|
@ -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 {@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>, <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)) |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue