RFR: 8167659: Access of mark word should use oopDesc::mark_offset_in_bytes() instead of '0'

David Holmes david.holmes at oracle.com
Thu Oct 13 10:21:09 UTC 2016


Hi Roman,

On 13/10/2016 7:40 PM, Roman Kennke wrote:
> In several places in Hotspot's assembly routines, we're using
> Address(obj, 0) to access the object's mark word. This is bad style and
> makes it very hard to find all the places where the mark word is used.
> It should use Address(obj, oopDesc::mark_offset_in_bytes()) instead.

The changes from 0 seem fine.

The additional asserts make me think that something as basic as:

assert(oopDesc::mark_offset_in_bytes() == 0, "assumption");

should only ever need to be checked once when the VM is initialized.

> The change addresses the issue in x86 and aarch64. I'm not familiar
> with the othe arches, maybe somebody wants to check and fill them in?

I can't speak to that - I'm not in a position to do it.

However this is an enhancement not a bug so realistically it is not a 
cleanup that should be being done in JDK 9 at this time. Unless you want 
to go through the FC extension process.

Thanks,
David

> http://cr.openjdk.java.net/~rkennke/markoffset-hs/webrev.00/
>
> Roman
>


More information about the hotspot-dev mailing list