RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21]
Stefan Karlsson
stefank at openjdk.org
Thu Sep 19 05:53:49 UTC 2024
On Thu, 19 Sep 2024 05:35:34 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
>>
>> JVMCI support
>
> 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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1766186545
More information about the serviceability-dev
mailing list