RFR: 8272147: Consolidate preserved marks handling with other STW collectors
Thomas Schatzl
tschatzl at openjdk.org
Tue Jun 6 08:03:55 UTC 2023
On Mon, 5 Jun 2023 17:00:14 GMT, Guoxiong Li <gli at openjdk.org> wrote:
>> 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`.
You can replace that code with `PreservedMarks::adjust_during_full_gc` from what I can see; the additional code in `MarkSweep::adjust_pointer` only deals with the generic case if the passed `oop` is null, which can't be the case for oops in the preserved marks set.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14274#discussion_r1219129319
More information about the hotspot-gc-dev
mailing list