[master] RFR: Unconditionally preserve all marks during GC
Aleksey Shipilev
shade at openjdk.java.net
Wed May 19 13:13:12 UTC 2021
On Wed, 19 May 2021 10:27:20 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
>> src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp line 120:
>>
>>> 118: // fixed when restoring the preserved marks.
>>> 119: assert(object->mark() == markWord::prototype_for_klass(object->klass()) || // Correct mark
>>> 120: object->mark_must_be_preserved() || // Will be restored by PreservedMarksSet
>>
>> It would seem this assert checks that mark is correct or it would be preserved. Since all marks are now preserved, this assert is basically `true` at all times? If you just drop `object->mark_must_be_preserved()`, it should be failing with forwarded objects, no?
>
> This block concerns about non-forwarded objects because forwarded objects are handled above.
OK, but I am still confused what `mark_must_be_preserved` case does in the original assert. Faithfully, you would need to replace that case with `true`, and then the whole assert should fold to always passing? Maybe it handles identityHashCode-bearing or displaced-header objects?
-------------
PR: https://git.openjdk.java.net/lilliput/pull/6
More information about the lilliput-dev
mailing list