RFR: 8305896: Alternative full GC forwarding [v20]
Roman Kennke
rkennke at openjdk.org
Wed May 3 11:16:25 UTC 2023
On Wed, 3 May 2023 11:08:04 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
>>
>> More Thomas' comments
>
> src/hotspot/share/gc/shared/slidingForwarding.cpp line 153:
>
>> 151: // Set from and to in new or found entry.
>> 152: entry->_from = from;
>> 153: entry->_to = to;
>
> Why so complicated? Proposal:
>
> while (entry != nullptr && entry->_from != from) {
> entry = entry->_next;
> }
> if (entry == nullptr) {
> FallbackTableEntry* new_entry = NEW_C_HEAP_OBJ(FallbackTableEntry, mtGC);
> new_entry->next = head;
> new_entry->_from = from;
> head = entry = new_entry;
> }
> entry->_to = to;
Uhm, so this would not change the actual head
> Why so complicated? Proposal:
>
> ```
> while (entry != nullptr && entry->_from != from) {
> entry = entry->_next;
> }
> if (entry == nullptr) {
> FallbackTableEntry* new_entry = NEW_C_HEAP_OBJ(FallbackTableEntry, mtGC);
> new_entry->next = head;
> new_entry->_from = from;
> head = entry = new_entry;
> }
> entry->_to = to;
> ```
Remember that head points into the array. We cannot actually prepend the new entry, we can only insert it as the first linked entry after head. If I see it correctly, it would not actually change the head-entry (the stuff in the array) except for its _to field. Also, the new_entry would not get linked anywhere. Or what am I missing?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13582#discussion_r1183550376
More information about the shenandoah-dev
mailing list