RFR: 8367240: Parallel: Refactor PSScavengeCLDClosure [v2]

Albert Mingkun Yang ayang at openjdk.org
Tue Sep 9 15:28:15 UTC 2025


On Tue, 9 Sep 2025 15:16:55 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   review
>
> src/hotspot/share/gc/parallel/psClosure.inline.hpp line 94:
> 
>> 92: 
>> 93:     // Scavenges a single oop in a ClassLoaderData.
>> 94:     class CLDOopClosure : public OopClosure {
> 
> This makes the do_cld function much harder to read, IMHO. So, three alternatives:
> 1) Keep the class outside PSScavengeCLDClosure, just like it was before this patch.
> 2) Have the class inside PSScavengeCLDClosure, but not in a function
> 3) Have the class inside a function inside PSScavengeCLDClosure.
> 
> I prefer (1) because it allows you to look at PSScavengeCLDClosure without having to see the details about the second class. I'm OK with (2) and like that it encapsulates the other class. I don't think we should do (3) because it significantly hurts the readability of do_cld.

I have moved the oop-closure class def outside.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27165#discussion_r2334009517


More information about the hotspot-gc-dev mailing list