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

Albert Mingkun Yang ayang at openjdk.org
Wed Jun 7 13:42:58 UTC 2023


On Wed, 7 Jun 2023 12:03:31 GMT, Guoxiong Li <gli at openjdk.org> wrote:

>> src/hotspot/share/gc/serial/markSweep.cpp line 200:
>> 
>>> 198:   // adjust the oops we saved earlier
>>> 199:   for (size_t i = 0; i < _preserved_count; i++) {
>>> 200:     MarkSweep::adjust_pointer(_preserved_marks[i].get_oop_pointer());
>> 
>> There are still some unnecessary null-checks.
>> 
>> I wonder if one can add new API in `PreservedMarks` to adjust oops.
>> 
>> 
>> void adjust_preserved_mark(OopAndMarkWord* elem) {
>>   oop obj = elem->get_oop();
>>   if (obj->is_forwarded()) {
>>     elem->set_oop(obj->forwardee());
>>   }
>> }
>> 
>> 
>> Then `_preserved_marks[]` serves just as a buffer to the overflow array  -- how their contents are processed is decided at one place and outside Serial.
>
>> I wonder if one can add new API in PreservedMarks to adjust oops.
> 
> Should I add it in this patch? And, if such method is added, the method `PreservedMarks::adjust_during_full_gc` can use it too.

Yes, please.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14274#discussion_r1221623001


More information about the hotspot-gc-dev mailing list