Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2176732 | 7 | Yumin Qi | P3 | Closed | Fixed | b03 |
JDK-2171794 | 6u4 | Yumin Qi | P3 | Resolved | Fixed | b03 |
Integer.reverseBytes() implements endianness conversion as:
public static int reverseBytes(int i) {
return ((i >>> 24) ) |
((i >> 8) & 0xFF00) |
((i << 8) & 0xFF0000) |
((i << 24));
}
Some architectures include instructions that do just that: BSWAP on x86 and LDUWA on SPARC, but HotSpot currently does not take advantage of them.
Similarly for Long.reverseBytes().
public static int reverseBytes(int i) {
return ((i >>> 24) ) |
((i >> 8) & 0xFF00) |
((i << 8) & 0xFF0000) |
((i << 24));
}
Some architectures include instructions that do just that: BSWAP on x86 and LDUWA on SPARC, but HotSpot currently does not take advantage of them.
Similarly for Long.reverseBytes().
- backported by
-
JDK-2171794 Optimize Integer.reverseBytes()
- Resolved
-
JDK-2176732 Optimize Integer.reverseBytes()
- Closed
- relates to
-
JDK-6483694 nightly failure after 6431242 putback
- Resolved
-
JDK-6968348 Byteswapped memory access can point to wrong location after JIT
- Closed
-
JDK-6431243 Optimize Integer.rotateLeft()
- Resolved
-
JDK-6482634 storeI_reversed still spill on stack for pre- and post-loop
- Closed
(1 relates to)