RFR JDK-8141491: Unaligned memory access in Bits.c

Alan Bateman Alan.Bateman at oracle.com
Tue Jan 26 12:28:02 UTC 2016

On 26/01/2016 04:57, Mikael Vidstedt wrote:
> I've finally found some time to return to this and have a new version 
> of the patch which looks more promising:
> http://cr.openjdk.java.net/~mikael/webrevs/8141491/webrev.02/webrev/
> This uses memcpy to read/write the native data and the preliminary 
> benchmark numbers on linux/x64 shows the expected performance. I'll 
> work on verifying that it doesn't impact other platforms negatively 
> over the next days/weeks.
> Btw, I also played around with implementing it in pure Java, but there 
> are some issues getting C2 to correctly vectorize the loop given the 
> native data accesses, so the native code seems to be needed for now.
This looks good and maybe it was a good thing that the compiler upgrade 
ran into this. We eliminated most of the native methods in this area a 
few years ago but had to leave the byte swapping methods. It would be 
good to eliminate those some day.


More information about the hotspot-dev mailing list