RFR: 8297209: Serial: Refactor GenCollectedHeap::full_process_roots

Albert Mingkun Yang ayang at openjdk.org
Fri Nov 25 12:43:25 UTC 2022


On Fri, 25 Nov 2022 11:23:00 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Simple change of replacing `MarkingCodeBlobClosure` with `CodeBlobToOopClosure` in the adjust-phase of Full GC.
>> 
>> Test: tier1-5
>
> src/hotspot/share/gc/shared/genCollectedHeap.cpp line 799:
> 
>> 797:   const bool is_marking_phase = !is_adjust_phase;
>> 798: 
>> 799:   if (is_marking_phase) {
> 
> I do not think it is useful to explicitly create a local variable of the inverse of a parameter for its single use. That looks like the parameter is wrong.
> 
> I recommend either using `is_adjust_phase` directly here (potentially swapping the branches) or change the parameter of the method and the callers if you prefer to have `is_marking_phase` here.

After this change, it becomes apparent this method should be split into two, for marking/adjust phase respectively, which I plan to address in the next PR.

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

PR: https://git.openjdk.org/jdk/pull/11210


More information about the hotspot-gc-dev mailing list