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

Roman Kennke rkennke at redhat.com
Thu Oct 13 10:25:26 UTC 2016


Am Donnerstag, den 13.10.2016, 20:21 +1000 schrieb David Holmes:
> 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.

I put them there because there's cmpxchg right below that uses obj directly as address. This way I reach my primary goal: identifying the places that access the mark word, while not complicating the
code with additional (and pointless) lea instructions to build an obj+0 address.

> 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.

No, I don't. So we put that on hold until jdk10-dev is branched off?

Roman



More information about the hotspot-dev mailing list