RFR: 8261027: AArch64: Support for LSE atomics C++ HotSpot code [v2]

Andrew Haley aph at openjdk.java.net
Mon Feb 8 18:50:10 UTC 2021


On Mon, 8 Feb 2021 12:23:31 GMT, Andrew Dinn <adinn at openjdk.org> wrote:

>> src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.hpp line 95:
>> 
>>> 93: template<>
>>> 94: template<typename D, typename I>
>>> 95: inline D Atomic::PlatformAdd<4>::fetch_and_add(D volatile* dest, I add_value,
>> 
>> It may be possible to avoid the cut-and-paste involved in declaring almost exactly the same template body for byte_size == 4 and 8 with a generic template which includes a function type element supplemented with two auxiliary templates to instantiate that function element with either aarch64_atomic_fetch_add_4_impl or aarch64_atomic_fetch_add_8_impl. That would mean more templates but less repetition. On the whole I prefer less templates so perhaps this is best left as is.
>
> n.b. the same comment applies to the cut and paste for  PlatformCchg and PlatformCmpxchg

Lawks! Even Oracle didn't do that with Linux/x86. I think I'll leave it as it is.

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

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


More information about the hotspot-dev mailing list