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

Stefan Karlsson stefank at openjdk.org
Wed Aug 23 11:46:44 UTC 2023


On Fri, 18 Aug 2023 16:20:21 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> Thanks, Stefan for checking this. Yes, arrayOop::header_size() is confusing. The only purpose of this method is to help a few code paths which need the header_size_in_bytes() to be aligned-up and converted to word-size. Not quite sure how to deal with it. Move it out to some different place? Name it differently?

I want to make sure that we are on the same page about this: Do you agree with my assessment that that arrayOopDesc::header_size() does *not* align-up arrayOopDesc::header_size_in_bytes() in *all* configurations, and that that needs to be fixed? That was the main point of my post above.

Personally, I think we could keep the function in arrayOopDesc as long as we give descriptive name that shows the readers that the function returns a something larger than the actual header size. Maybe `aligned_header_size[_in_words]` or `align_up_header_size[_in_words]?

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

PR Comment: https://git.openjdk.org/jdk/pull/11044#issuecomment-1689811416


More information about the hotspot-dev mailing list