RFR: 8284734: Undiscovered references if using ReferentBasedDiscovery
Albert Mingkun Yang
ayang at openjdk.java.net
Mon Apr 18 10:42:41 UTC 2022
On Mon, 18 Apr 2022 08:57:05 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Small change of fixing a crash if using `ReferentBasedDiscovery`.
>>
>> Test: hotspot_gc
>
> src/hotspot/share/gc/shared/referenceProcessor.cpp line 998:
>
>> 996: }
>> 997:
>> 998: HeapWord* const discovered_addr = java_lang_ref_Reference::discovered_addr_raw(obj);
>
> The lookup of discovered_addr could be moved later to where it's used.
I will do a clean-up PR afterwards. Thank you for the suggestion.
> src/hotspot/share/gc/shared/referenceProcessor.cpp line 1005:
>
>> 1003: // following two cases:
>> 1004: // 1. `G1CMTask::make_reference_grey` can push the same oop twice onto the
>> 1005: // mark stack.
>
> I think make_reference_grey uses the next-mark-bits to avoid pushing an oop onto the mark stack multiple times.
True, but due to the use of `_finger` (bounded mark-stack), duplicate oops can still exist. The comment in that method covers that.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8196
More information about the hotspot-gc-dev
mailing list