RFR: 8139457: Array bases are aligned at HeapWord granularity [v50]

Roman Kennke rkennke at openjdk.org
Wed Aug 16 20:54:45 UTC 2023


On Wed, 16 Aug 2023 18:25:36 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> > I did that in an earlier version of this PR and it looked quite messy ...
> 
> I just checked the first commit and the `MacroAssembler` part matches what I have in mind. I believe that diff being messy is due to "Calculations of min and max array and tlab sizes".

Yes, that is another part of it. I can re-instate the parts where we initialize the leading 4 bytes in the body, if agree that this is the way to go.
 
> > so we would have to check if the body is aligned or not, and if not, add an extra store
> 
> The store, as I understand it, belongs to the body (payload) semantically. Mixing stores btw `initialize_header` and `initialize_body` is super confusing, IMO.


Yes, I understand that.
 
> > This is also consistent with how we store the klass-gap in instance objects there.
> 
> klass-gap is part of the header, so it makes sense to be in `initialize_header`.

No, klass-gap really is not part of the header. For non-array objects, this gap is where the first bunch of fields go, it really is payload. So, arguably, we should move the clearing of the gap into initialize_body(), too - but not as part of this PR.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/11044#discussion_r1296411005


More information about the hotspot-dev mailing list