RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21]
Stefan Karlsson
stefank at openjdk.org
Mon Oct 7 08:55:59 UTC 2024
On Thu, 19 Sep 2024 05:36:41 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> src/hotspot/share/gc/parallel/psParallelCompact.cpp line 787:
>>
>>> 785: // The gap is always equal to min-fill-size, so nothing to do.
>>> 786: return;
>>> 787: }
>>
>> Reading the comment, it is not obvious that this is correct if you set MinObjectAlignment to something larger than the default value:
>>
>> void PSParallelCompact::fill_dense_prefix_end(SpaceId id) {
>> // Comparing two sizes to decide if filling is required:
>> //
>> // The size of the filler (min-obj-size) is 2 heap words with the default
>> // MinObjAlignment, since both markword and klass take 1 heap word.
>> //
>> // The size of the gap (if any) right before dense-prefix-end is
>> // MinObjAlignment.
>> //
>> // Need to fill in the gap only if it's smaller than min-obj-size, and the
>> // filler obj will extend to next region.
>>
>> // Note: If min-fill-size decreases to 1, this whole method becomes redundant.
>> if (UseCompactObjectHeaders) {
>> // The gap is always equal to min-fill-size, so nothing to do.
>> return;
>> }
>> assert(CollectedHeap::min_fill_size() >= 2, "inv");
>
> Style note: The added code is inserted between a comment and the code that the comment refers to. It would be nice to tidy this up.
Did you figure out if the code above is correct w.r.t. `MinObjectAlignment=16`?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1789797050
More information about the hotspot-gc-dev
mailing list