Unsafe.{get,put}-X-Unaligned; Efficient array comparison intrinsics

Peter Levart peter.levart at gmail.com
Sun Mar 8 23:04:09 UTC 2015



On 03/08/2015 12:13 PM, Andrew Haley wrote:
>> >That's OK if you think this approach is a better division of
>> >concerns (Unsafe being low-level), but in Heap-X-Buffer you are only
>> >using Unsafe.get|putXXXUnaligned() and don't consider using
>> >get|putXXX directly when unalignedAccess() == true.
> Right, because there's no point in doing so when unalignedAccess() ==
> true because the exact same code will be generated.  In my Utopian
> world nothing except Unsafe would have to deal with issues such as
> this.  However, I think that people writing library code (e.g. array
> comparison intrinsics) might still need to know.

Ah, sorry. I haven't realized that the same code will be generated by 
compiler intrinsics. So the Java part is just for interpreter and 
platforms not supporting unaligned access and when UseUnalignedAccesses 
is explicitly disabled?

Peter

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20150309/56699802/attachment-0001.html>


More information about the hotspot-compiler-dev mailing list