RFR: 8139457: Array bases are aligned at HeapWord granularity [v23]
Roman Kennke
rkennke at openjdk.org
Tue Feb 21 11:10:48 UTC 2023
On Wed, 15 Feb 2023 14:40:20 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Clarify comment on arrayOopDesc::max_array_length()
>
> src/hotspot/share/gc/z/zObjArrayAllocator.cpp line 63:
>
>> 61: assert(is_aligned(base_offset, HeapWordSize), "remaining array base must be 64 bit aligned");
>> 62:
>> 63: const size_t header = heap_word_size(base_offset);
>
> `base_offset` has already been aligned by the code above, so we don't have to call heap_word_size here and can simply divide with HeapWordSize.
Regarding MemAllocator::obj_memory_range(): why do we even need to exclude array header from the bad-heap-word-check, when not zeroing? It seems reasonable to also check the header word(s) in any case. I'd just remove ObjArrayAllocator::obj_memory_range() and always use the full object range, as implemented by MemAllocator::obj_memory_range().
-------------
PR: https://git.openjdk.org/jdk/pull/11044
More information about the hotspot-dev
mailing list