From f89780eea6d5a0c4820892a2673bffbc44e79bbd Mon Sep 17 00:00:00 2001 From: Xubo Zhang Date: Mon, 19 Jul 2021 17:47:08 -0700 Subject: [PATCH] enable serialize in Windows --- src/hotspot/os_cpu/linux_x86/os_linux_x86.hpp | 1 - .../os_cpu/windows_x86/orderAccess_windows_x86.hpp | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) mode change 100644 => 100755 src/hotspot/os_cpu/windows_x86/orderAccess_windows_x86.hpp diff --git a/src/hotspot/os_cpu/linux_x86/os_linux_x86.hpp b/src/hotspot/os_cpu/linux_x86/os_linux_x86.hpp index b9a17e33912..979006035cc 100644 --- a/src/hotspot/os_cpu/linux_x86/os_linux_x86.hpp +++ b/src/hotspot/os_cpu/linux_x86/os_linux_x86.hpp @@ -27,7 +27,6 @@ static void setup_fpu(); static bool supports_sse(); -// static bool supports_serialize(); static juint cpu_microcode_revision(); static jlong rdtsc(); diff --git a/src/hotspot/os_cpu/windows_x86/orderAccess_windows_x86.hpp b/src/hotspot/os_cpu/windows_x86/orderAccess_windows_x86.hpp old mode 100644 new mode 100755 index f7d990a64c4..30cfe1277fb --- a/src/hotspot/os_cpu/windows_x86/orderAccess_windows_x86.hpp +++ b/src/hotspot/os_cpu/windows_x86/orderAccess_windows_x86.hpp @@ -28,6 +28,7 @@ // Included in orderAccess.hpp header file. #include +#include // Compiler version last used for testing: Microsoft Visual Studio 2010 // Please update this information when this file changes @@ -59,8 +60,12 @@ inline void OrderAccess::fence() { } inline void OrderAccess::cross_modify_fence_impl() { - int regs[4]; - __cpuid(regs, 0); + if (VM_Version::supports_serialize()) { + _serialize(); + } else { + int regs[4]; + __cpuid(regs, 0); + } } #endif // OS_CPU_WINDOWS_X86_ORDERACCESS_WINDOWS_X86_HPP