RFR: 8297209: Serial: Refactor GenCollectedHeap::full_process_roots

Thomas Schatzl tschatzl at openjdk.org
Fri Nov 25 13:21:14 UTC 2022


On Fri, 25 Nov 2022 12:41:12 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> 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.

I would not mind doing this in this PR - it is called `Refactor GenCollectedHeap::full_process_roots` after all, but I do not mind.

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

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


More information about the hotspot-gc-dev mailing list