RFR: 8272147: Consolidate preserved marks handling with other STW collectors
Guoxiong Li
gli at openjdk.org
Mon Jun 5 17:03:06 UTC 2023
On Mon, 5 Jun 2023 16:16:32 GMT, Albert Mingkun Yang <ayang 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
>
> src/hotspot/share/gc/shared/preservedMarks.hpp line 60:
>
>> 58:
>> 59: public:
>> 60: OopAndMarkWordStack& get_stack() { return _stack; }
>
> Could you explain why this new API is required for Serial but not other collectors, e.g. G1? (IOW, can Serial do sth similar as G1 so that no new API is introduced?)
The methods `MarkSweep::adjust_pointer` and `PreservedMarks::adjust_during_full_gc` have different implementations. The method `MarkSweep::adjust_pointer` seems doing more thing. So in `MarkSweep::adjust_marks`, I use `get_stack` to get the stack and invoke `MarkSweep::adjust_pointer` explicitly. If you can confirm `PreservedMarks::adjust_during_full_gc` is good to replace `MarkSweep::adjust_pointer`, I will remove `get_stack` and use `PreservedMarks::adjust_during_full_gc` instead of `MarkSweep::adjust_pointer`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14274#discussion_r1218348409
More information about the hotspot-gc-dev
mailing list