RFR: 8272147: Consolidate preserved marks handling with other STW collectors [v5]

Thomas Schatzl tschatzl at openjdk.org
Mon Jun 12 12:22:42 UTC 2023


On Thu, 8 Jun 2023 14:09:08 GMT, Guoxiong Li <gli at openjdk.org> wrote:

>> Hi all,
>> 
>> This patch removes the class `markSweep.hpp::PreservedMark` and uses the shared `PreservedMarksSet` instead.
>> 
>> In order to keep the meaning of the field `_preserved_marks` in `markSweep`,
>> I need to use `OopAndMarkWord` explicitly. So I move `OopAndMarkWord` out of `PreservedMarks`.
>> 
>> Tests:
>> `hotspot:tier1` passed locally (x86 & linux).
>> 
>> Thanks for the review.
>> 
>> Best Regards,
>> -- Guoxiong
>
> Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Rename OopAndMarkWork to PreservedMark.

Lgtm.
Please fix the naming suggested by @rkennke though before pushing.

src/hotspot/share/gc/shared/preservedMarks.cpp line 45:

> 43: void PreservedMarks::adjust_preserved_mark(PreservedMark* elem) {
> 44:   oop obj = elem->get_oop();
> 45:   if (obj->is_forwarded()) {

Pre-existing: we probably only need to check this because G1 full gc preserves marks during marking, unlike the other collectors which (attempt to) preserve marks for actually forwarded objects.
I'll file an RFE for this.

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

Marked as reviewed by tschatzl (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/14274#pullrequestreview-1474790550
PR Review Comment: https://git.openjdk.org/jdk/pull/14274#discussion_r1226577332


More information about the hotspot-gc-dev mailing list