RFR: 8362193: Re-work MacOS/AArch64 SpinPause to handle SB [v2]

Aleksey Shipilev shade at openjdk.org
Mon Jul 21 16:29:24 UTC 2025


On Mon, 21 Jul 2025 16:17:23 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Exactly. When writing inline asm, it doesn't much help to try to out-guess the compiler.
>
>> I agree with you. I proposed to use the switch when JDK-8321371 was being reviewed: [#16994 (comment)](https://github.com/openjdk/jdk/pull/16994#issuecomment-1865147655)
>> 
>> Frederick (@fbredber) wanted to avoid branches: [#16994 (comment)](https://github.com/openjdk/jdk/pull/16994#issuecomment-1865955740)
> 
> You're getting branches, one way or the other.

I actually like the compiler version, especially if we lay out enums in some sane order. In current inline assembly, adding a new case makes some branches _longer_; probably irrelevant on this small scale, but still. With compiler-compiled switch, we effectively get new additions like `SB` for "free", as every other label stays in place.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26387#discussion_r2219677824


More information about the hotspot-dev mailing list