RFR: 8322383: G1: Only preserve marks on objects that are actually moved [v2]
Albert Mingkun Yang
ayang at openjdk.org
Fri Jan 12 09:54:23 UTC 2024
On Mon, 8 Jan 2024 16:41:59 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Move assert to GC-specific code
>
> src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp line 106:
>
>> 104: // Store a forwarding pointer if the object should be moved.
>> 105: if (cast_from_oop<HeapWord*>(object) != _compaction_top) {
>> 106: preserved_stack()->push_if_necessary(object, object->mark());
>
> Can this be made conditionally on whether the markword is NOT marked/forwarded? (IOW, move the added predicate in `markWord` here.) The rationale is to minimize changes to the shared code for G1 specific usages.
My previous msg was probably unclear... I meant sth like:
if (!object->is_forwarded) {
preserved_stack()->push_if_necessary...
}
(The newly added assert here is incorrect -- fails in GHA.)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17159#discussion_r1450155749
More information about the hotspot-gc-dev
mailing list