RFR: 8369238: Allow virtual thread preemption on some common class initialization paths [v10]

Patricio Chilano Mateo pchilanomate at openjdk.org
Wed Oct 29 20:38:22 UTC 2025


On Wed, 29 Oct 2025 06:00:40 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   add const to references
>
> src/hotspot/share/runtime/continuationFreezeThaw.cpp line 2735:
> 
>> 2733:   HandleMarkCleaner hm(current);  // Cleanup all handles (including so._conth) before returning to Java.
>> 2734:   ContinuationWrapper::SafepointOp so(current, _cont);
>> 2735:   AnchorMark am(current, top);  // Set the anchor so that the stack is walkable.
> 
> Shouldn't you delete the `clear_anchor` at line 2739 below?

Yes, good catch. Removed.

> src/hotspot/share/runtime/thread.cpp line 578:
> 
>> 576: 
>> 577: bool Thread::TrySpinAcquire(volatile int * adr) {
>> 578:   return AtomicAccess::cmpxchg(adr, 0, 1) == 0;
> 
> How is this a try-spin-acquire operation ??? I don't think we need this, we can just inline the `cmpxchg` where needed.

Right, not sure why I used that class. I replaced it with the atomic operations.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27802#discussion_r2475345821
PR Review Comment: https://git.openjdk.org/jdk/pull/27802#discussion_r2475349441


More information about the hotspot-dev mailing list