RFR: 8328602: Parallel: Incorrect assertion in fill_dense_prefix_end

Guoxiong Li gli at openjdk.org
Thu Mar 21 13:05:20 UTC 2024


On Wed, 20 Mar 2024 11:13:23 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Relax too-strong assertion about min-filler-size to account for large obj-alignment.
> 
> Test: with explicit large obj-alignment

src/hotspot/share/gc/parallel/psParallelCompact.cpp line 1280:

> 1278:     return;
> 1279:   }
> 1280:   assert(CollectedHeap::min_fill_size() == 2, "inv");

When `MinObjAlignment` is 8 or 16 (`MinObjAlignment` is 1 or 2), the `min_fill_size()` returns **2**. When `ObjectAlignmentInBytes` is larger than 16 (`MinObjAlignment` is larger then 2), the `min_fill_size()` returns a value **larger than 2**.

According to the first `assert` statement and the `if` statement, we can know that:
After the `if` statement, the `MinObjAlignment` must be `1`, so the second `assert` statement must be `true`. Could these two `assert` statement be simplified to one?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18396#discussion_r1533865795


More information about the hotspot-gc-dev mailing list