src/java.base/share/classes/java/lang/Long.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/java.base/share/classes/java/lang/Long.java Fri Jun 26 17:30:20 2015
--- new/src/java.base/share/classes/java/lang/Long.java Fri Jun 26 17:30:19 2015
*** 26,35 ****
--- 26,36 ----
package java.lang;
import java.lang.annotation.Native;
import java.math.*;
import java.util.Objects;
+ import jdk.internal.HotSpotIntrinsicCandidate;
/**
* The {@code Long} class wraps a value of the primitive type {@code
* long} in an object. An object of type {@code Long} contains a
*** 1072,1081 ****
--- 1073,1083 ----
*
* @param l a long value.
* @return a {@code Long} instance representing {@code l}.
* @since 1.5
*/
+ @HotSpotIntrinsicCandidate
public static Long valueOf(long l) {
final int offset = 128;
if (l >= -128 && l <= 127) { // will cache
return LongCache.cache[(int)l + offset];
}
*** 1236,1245 ****
--- 1238,1248 ----
/**
* Returns the value of this {@code Long} as a
* {@code long} value.
*/
+ @HotSpotIntrinsicCandidate
public long longValue() {
return value;
}
/**
*** 1653,1662 ****
--- 1656,1666 ----
* ("leftmost") one-bit in the two's complement binary representation
* of the specified {@code long} value, or 64 if the value
* is equal to zero.
* @since 1.5
*/
+ @HotSpotIntrinsicCandidate
public static int numberOfLeadingZeros(long i) {
// HD, Figure 5-6
if (i == 0)
return 64;
int n = 1;
*** 1682,1691 ****
--- 1686,1696 ----
* one-bit in the two's complement binary representation of the
* specified {@code long} value, or 64 if the value is equal
* to zero.
* @since 1.5
*/
+ @HotSpotIntrinsicCandidate
public static int numberOfTrailingZeros(long i) {
// HD, Figure 5-14
int x, y;
if (i == 0) return 64;
int n = 63;
*** 1705,1714 ****
--- 1710,1720 ----
* @param i the value whose bits are to be counted
* @return the number of one-bits in the two's complement binary
* representation of the specified {@code long} value.
* @since 1.5
*/
+ @HotSpotIntrinsicCandidate
public static int bitCount(long i) {
// HD, Figure 5-2
i = i - ((i >>> 1) & 0x5555555555555555L);
i = (i & 0x3333333333333333L) + ((i >>> 2) & 0x3333333333333333L);
i = (i + (i >>> 4)) & 0x0f0f0f0f0f0f0f0fL;
*** 1808,1817 ****
--- 1814,1824 ----
* @param i the value whose bytes are to be reversed
* @return the value obtained by reversing the bytes in the specified
* {@code long} value.
* @since 1.5
*/
+ @HotSpotIntrinsicCandidate
public static long reverseBytes(long i) {
i = (i & 0x00ff00ff00ff00ffL) << 8 | (i >>> 8) & 0x00ff00ff00ff00ffL;
return (i << 48) | ((i & 0xffff0000L) << 16) |
((i >>> 16) & 0xffff0000L) | (i >>> 48);
}
src/java.base/share/classes/java/lang/Long.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File