RFR: 8360936: Test compiler/onSpinWait/TestOnSpinWaitAArch64.java fails after JDK-8359435 [v2]
Aleksey Shipilev
shade at openjdk.org
Mon Jul 7 15:47:44 UTC 2025
On Wed, 2 Jul 2025 08:49:45 GMT, Andrew Haley <aph at openjdk.org> wrote:
>>> OK, are you able to bisect which change? This fix to only do debug VM needs to be correctly linked to the actual cause, IMO.
>>
>>
>>
>>> > It looks like `XX:+PrintAssembly` prints out debug info in release builds but `XX:CompileCommand=print` does not. I am switching back to `XX:+PrintAssembly`.
>>>
>>> That's not great. What info do you need, exactly?
>>
>>
>> # {method} {0x0000ffff50400378} 'test' '()V' in 'compiler/onSpinWait/TestOnSpinWaitAArch64$Launcher'
>> # [sp+0x20] (sp of caller)
>> 0x0000ffff985731c0: ff83 00d1 | fd7b 01a9 | 2803 0018 | 8923 40b9 | 1f01 09eb
>>
>> 0x0000ffff985731d4: ;*synchronization entry
>> ; - compiler.onSpinWait.TestOnSpinWaitAArch64$Launcher::test at -1 (line 224)
>> 0x0000ffff985731d4: 2102 0054 | 1f20 03d5 | 1f20 03d5 | 1f20 03d5 | 1f20 03d5 | 1f20 03d5 | 1f20 03d5
>>
>> 0x0000ffff985731f0: ;*invokestatic onSpinWait {reexecute=0 rethrow=0 return_oop=0}
>> ; - compiler.onSpinWait.TestOnSpinWaitAArch64$Launcher::test at 0 (line 224)
>> 0x0000ffff985731f0: 1f20 03d5 | fd7b 41a9 | ff83 0091
>>
>> 0x0000ffff985731fc: ; {poll_return}
>> 0x0000ffff985731fc: 8817 40f9 | ff63 28eb | 4800 0054 | c003 5fd6
>>
>> 0x0000ffff9857320c: ; {internal_word}
>> 0x0000ffff9857320c: 88ff ff10 | 88a3 02f9
>>
>> 0x0000ffff98573214: ; {runtime_call SafepointBlob}
>> 0x0000ffff98573214: 5bc3 fe17
>>
>> 0x0000ffff98573218: ; {runtime_call Stub::method_entry_barrier}
>> 0x0000ffff98573218: 0850 96d2 | 480a b3f2 | e8ff dff2 | 0001 3fd6 | ecff ff17
>>
>>
>> The test searches for `- compiler.onSpinWait.TestOnSpinWaitAArch64$Launcher::test at 0` and `invokestatic onSpinWait`. They identify the place where to search instructions.
>>
>> Assembly from all builds always has `{poll_return}`. I can use it as a search point.
>
>> ```
>>
>> ```
>>
>>
>>
>>
>>
>> The test searches for `- compiler.onSpinWait.TestOnSpinWaitAArch64$Launcher::test at 0` and `invokestatic onSpinWait`. They identify the place where to search instructions.
>
> That's not great. C2 is free to move stuff around, so it's not certain this test will keep working. If you just want to make sure that the pattern is used, a block_comment() would be more reliable.
Then again, it does not address a central point: the test keeps relying on particular instruction scheduling, which is not reliable. Why do we even need to search for ldp+add anchor? Can we just blindly search for spin-wait-looking instructions? I would expect `block_comment` to be even more reliable, as @theRealAph suggested.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26072#issuecomment-3045677596
More information about the hotspot-compiler-dev
mailing list