RFR: 8272905: Consolidate discovered lists processing

Thomas Schatzl tschatzl at openjdk.java.net
Tue Aug 31 13:29:30 UTC 2021


On Tue, 24 Aug 2021 17:50:57 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Simple change of merging discovered list processing for four kinds of non-strong refs and some general cleanup around.
> 
> Test: tier1-3

Looks good to me as far as I can tell apart from the minor suggestion in `RefProcTask::process_discovered_list`, but I'm not too confident about the ins and outs of this code.

src/hotspot/share/gc/shared/referenceProcessor.cpp line 389:

> 387: 
> 388:     if (referent == NULL || iter.is_referent_alive()) {
> 389:       iter.make_referent_alive();

The handling for `NULL` referents is (just a bit) different for phantom refs than for the others, but seems inconsequential.

src/hotspot/share/gc/shared/referenceProcessor.cpp line 453:

> 451:   }
> 452: 
> 453:   assert(do_enqueue_and_clear != (ref_type == REF_FINAL), "Only Final refs are not enqueued");

Instead of this assert and the assignments to `do_enqeue_and_clear` above, `ref_type != REF_FINAL` could be passed to `process_discoved_list_work`.
That would tighten the code and make the assert obsolete.

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

Marked as reviewed by tschatzl (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/5242



More information about the hotspot-gc-dev mailing list