RFR: JDK-8283326: Implement SafeFetch statically

Thomas Stuefe stuefe at openjdk.java.net
Tue Apr 12 09:46:36 UTC 2022


On Tue, 12 Apr 2022 09:09:47 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/os_cpu/bsd_aarch64/safefetch_bsd_aarch64.S line 55:
>> 
>>> 53: SYMBOL(_SafeFetch32_continuation):
>>> 54:     mov      x0, x1
>>> 55:     ret
>> 
>> Minor: on RISC platforms you seems to prefer to pack exceptional and non-exceptional paths, and on x86 they are separated. If we align this with x86, we'd save an instruction in each execution of non-exceptional path, with an extra instruction in static code.
>> 
>>     ldr      w0, [x0]
>>     ret
>> SYMBOL(_SafeFetch32_continuation):
>>     mov      x0, x1
>>     ret
>
> I'm surprised this would work. Can you really specify the same register as load destination and as load source?

Ah, it seems to work. You live and learn :)

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

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


More information about the hotspot-dev mailing list