RFR: 8290324: Move atomic operations outside of os_xxx.hpp [v3]
Kim Barrett
kbarrett at openjdk.org
Wed Jul 20 23:26:09 UTC 2022
On Mon, 18 Jul 2022 21:49:54 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> The os_xxx.hpp files inject extra methods/fields that are specific to atomic operations into the `os` class. However, the injected methods/fields are used only by a specific os/cpu combination. Therefore, they should not be inside the `os` class, which should contain only APIs that are used across platforms.
>>
>> - For ports where the `atomic_copy64()` function is used in a single file, I moved it as an inline function in that file
>> - Otherwise it's moved to `atomic_<os>_<cpu>.hpp`
>> - The linux/arm port is a little more involved, but the new code should be a little cleaner than the old code.
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>
> @kimbarrett comments: cleaned up ARMAtomicFuncs; added "static inline". Also removed os:: from C_frame_offset on linux/arm.
Changes requested by kbarrett (Reviewer).
src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 586:
> 584: }
> 585:
> 586: static inline void atomic_copy64(const volatile void *src, volatile void *dst) {
Approving this (and the other places like it) would require that I read up on the interaction between static in this context and the C-linkage specification. Why not just put this definition at ordinary global scope?
-------------
PR: https://git.openjdk.org/jdk/pull/9501
More information about the hotspot-runtime-dev
mailing list