RFR: 8186670: Implement _onSpinWait() intrinsic for AArch64 [v3]

Andrew Haley aph at openjdk.java.net
Wed Sep 22 07:53:04 UTC 2021


On Wed, 22 Sep 2021 03:03:02 GMT, Nick Gasson <ngasson at openjdk.org> wrote:

>> Evgeny Astigeevich has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Move emitting code to MacroAssembler::spin_wait
>>   
>>   Code emitting spin pauses is moved to MacroAssembler::spin_wait.
>>   As OptoAssembly output is changed, tests are updated to parse
>>   PrintAssembly.
>
> src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp line 1385:
> 
>> 1383:   // Code for java.lang.Thread::onSpinWait() intrinsic.
>> 1384:   void spin_wait() {
>> 1385: #define EMIT_N_INST(n, inst) for (int i = 0; i < (n); ++i) inst()
> 
> Why use a macro here? You could just put the loop around the switch statement. And the method body seems sufficiently large that it ought to go in the .cpp file.

Good point. There's no significant performance advantage to having this in the header.

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

PR: https://git.openjdk.java.net/jdk/pull/5562


More information about the hotspot-dev mailing list