RFR: 8367848: Parallel: Use NMethodToOopClosure during Young GC [v2]

Stefan Karlsson stefank at openjdk.org
Wed Sep 17 15:10:33 UTC 2025


On Wed, 17 Sep 2025 14:54:55 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Replace `MarkingNMethodClosure` with `NMethodToOopClosure` during young-gc. After that, a new local `ThreadsClaimTokenScope` is introduced instead of `StrongRootsScope` to make the thread-claim-token logic visible in the current context.
>>  
>> Test: tier1-3
>
> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review

Adding runtime because this now also touches the Threads class.

src/hotspot/share/gc/parallel/psScavenge.cpp line 237:

> 235: 
> 236: class ScavengeRootsTask : public WorkerTask {
> 237:   Threads::ThreadsClaimTokenScope _threads_claim_token_scope; // needed for Threads::possibly_parallel_threads_do

I wonder if this class could just be named ClaimTokenScope so that we don't need to see the word Threads twice?

Threads::ThreadsClaimTokenScope

vs

Threads::ClaimTokenScope

OTOH, the function is named `change_thread_claim_token`. Maybe the second reviewer could weigh in on this.

src/hotspot/share/runtime/threads.hpp line 112:

> 110:       Threads::assert_all_threads_claimed();
> 111:     }
> 112:   };

I wonder if the implementation should be moved to the cpp file or if we consider this small enough to include here?

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

PR Comment: https://git.openjdk.org/jdk/pull/27336#issuecomment-3303451470
PR Review Comment: https://git.openjdk.org/jdk/pull/27336#discussion_r2355850180
PR Review Comment: https://git.openjdk.org/jdk/pull/27336#discussion_r2355850649


More information about the hotspot-runtime-dev mailing list