RFR: 8264543: Cross modify fence optimization for x86 [v2]
David Holmes
dholmes at openjdk.java.net
Fri Jul 16 06:24:12 UTC 2021
On Thu, 15 Jul 2021 18:12:31 GMT, Xubo Zhang <github.com+58006833+xbzhang99 at openjdk.org> wrote:
>> What actually happens if you just include vm_version.hpp in orderAccess_linux_x86.hpp ?
>
> it will give me errors, like 'Atomic' has not been declared.
> Also, the cross_modify_fence_impl actually is os-dependent. Linux and Windows have different implementations.
vm_version_x86.hpp has a dependency on universe.hpp which has a dependency on orderAccess.hpp which is why that circularity problem arises. That can be fixed by moving the inline definition of `supports_clflush()` (which calls `Universe::is_fully_initialized()`) out of vm_version_x86.hpp into vm_version_x86.cpp. We can then proceed to include vm_version.hpp in orderAccess.hpp (something I'm surprised is not already done as I recall CPU specific memory barriers being used back in JDK 7 and 8). That change (of course) requires a few other tweaks, so I put the changes together here and ran them through our build system.
https://github.com/openjdk/jdk/compare/master...dholmes-ora:orderAccess-vm_version?expand=1
-------------
PR: https://git.openjdk.java.net/jdk/pull/3334
More information about the hotspot-dev
mailing list