RFR JDK-8141491: Unaligned memory access in Bits.c
Brian Burkhalter
brian.burkhalter at oracle.com
Tue Jan 26 16:13:06 UTC 2016
On 1/26/16 4:28 AM, Alan Bateman wrote:
>
> 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.
I concur that this looks OK. Don't forget to update the latest copyright
year to 2016.
Thanks,
Brian
More information about the core-libs-dev
mailing list