RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v12]

Patricio Chilano Mateo pchilanomate at openjdk.org
Tue Nov 5 14:34:22 UTC 2024


On Tue, 5 Nov 2024 06:30:55 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Great, thanks Dean. I removed `possibly_adjust_frame()` and the related code.
>> @RealFYang I made the equivalent change for riscv, could you verify it's okay?
>
> @pchilano : Hi, Great to see `possibly_adjust_frame()` go away. Nice cleanup!
> `hotspot_loom jdk_loom` still test good with both release and fastdebug builds on linux-riscv64 platform.
> 
> BTW: I noticed one more return miss prediction case which I think was previously missed in https://github.com/openjdk/jdk/pull/21565/commits/32840de91953a5e50c85217f2a51fc5a901682a2
> Do you mind adding following small addon change to fix it? Thanks.
> 
> diff --git a/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp b/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp
> index 84a292242c3..ac28f4b3514 100644
> --- a/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp
> +++ b/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp
> @@ -1263,10 +1263,10 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
>    if (LockingMode != LM_LEGACY) {
>      // Check preemption for Object.wait()
>      Label not_preempted;
> -    __ ld(t0, Address(xthread, JavaThread::preempt_alternate_return_offset()));
> -    __ beqz(t0, not_preempted);
> +    __ ld(t1, Address(xthread, JavaThread::preempt_alternate_return_offset()));
> +    __ beqz(t1, not_preempted);
>      __ sd(zr, Address(xthread, JavaThread::preempt_alternate_return_offset()));
> -    __ jr(t0);
> +    __ jr(t1);
>      __ bind(native_return);
>      __ restore_after_resume(true /* is_native */);
>      // reload result_handler

Thanks for checking. Added changes to `TemplateInterpreterGenerator::generate_native_entry`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1829457335


More information about the core-libs-dev mailing list