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

Albert Mingkun Yang ayang at openjdk.org
Wed Aug 16 09:43:28 UTC 2023


On Tue, 15 Aug 2023 17:08:17 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> And we are using the header-size without the gap in order to determine if we need an extra store to initialize the gap. E.g.:

I suspect the store to the gap is related to the following comment/diff:


  // We align-up the header size to word-size, because we clear the
  // possible alignment gap in initialize_header().
  int hdr_size = align_up(base_offset_in_bytes, BytesPerWord);
  initialize_body(obj, arr_size, hdr_size, len_zero);


Wonder if sth like `initialize_body(obj, arr_size, base_offset_in_bytes, len_zero);` can make the header/body classification more explicit. Ofc, `zero_memory` needs to be extended somehow to support non-word-align start-addr.

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

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


More information about the hotspot-dev mailing list