RFR (S): 8191681: Unsafe accesses should use field_offset_to_byte_offset()
Erik Österlund
erik.osterlund at oracle.com
Fri Nov 24 14:45:36 UTC 2017
Hi,
Before the Access API, there was a no-op conversion function in
unsafe.cpp for getting the byte offset of a field offset from unsafe as
a jlong. Now, the field offsets *are* byte offsets, so the conversion
did not do anything. But I guess it could be useful nevertheless for
abstraction purposes.
In this patch I have a new function called field_offset_to_access_offset
that gets the offset to be used by Access (ptrdiff_t) from a field
offset, and uses that for the access calls.
Bug:
https://bugs.openjdk.java.net/browse/JDK-8191681
Webrev:
http://cr.openjdk.java.net/~eosterlund/8191681/webrev.00/
Thanks,
/Erik
More information about the hotspot-runtime-dev
mailing list