--- old/src/cpu/x86/vm/vm_version_x86.cpp 2014-03-28 18:18:29.000000000 -0700 +++ new/src/cpu/x86/vm/vm_version_x86.cpp 2014-03-28 18:18:29.000000000 -0700 @@ -385,6 +385,14 @@ }; +void VM_Version::getPsrInfo_wrapper() { + getPsrInfo_stub(&_cpuid_info); +} + +#ifndef TARGET_OS_FAMILY_windows + #define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) f() +#endif + void VM_Version::get_processor_features() { _cpu = 4; // 486 by default @@ -395,7 +403,11 @@ if (!Use486InstrsOnly) { // Get raw processor info - getPsrInfo_stub(&_cpuid_info); + + // Some platforms (like Win*) need a wrapper around here + // in order to properly handle SEGV for YMM registers test. + CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(getPsrInfo_wrapper); + assert_is_initialized(); _cpu = extended_cpu_family(); _model = extended_cpu_model(); --- old/src/cpu/x86/vm/vm_version_x86.hpp 2014-03-28 18:18:30.000000000 -0700 +++ new/src/cpu/x86/vm/vm_version_x86.hpp 2014-03-28 18:18:29.000000000 -0700 @@ -507,6 +507,7 @@ // The value used to check ymm register after signal handle static int ymm_test_value() { return 0xCAFEBABE; } + static void getPsrInfo_wrapper(); static void set_cpuinfo_segv_addr(address pc) { _cpuinfo_segv_addr = pc; } static bool is_cpuinfo_segv_addr(address pc) { return _cpuinfo_segv_addr == pc; } static void set_cpuinfo_cont_addr(address pc) { _cpuinfo_cont_addr = pc; } --- old/src/os/windows/vm/os_windows.cpp 2014-03-28 18:18:33.000000000 -0700 +++ new/src/os/windows/vm/os_windows.cpp 2014-03-28 18:18:33.000000000 -0700 @@ -2716,7 +2716,6 @@ } #endif -#ifndef PRODUCT void os::win32::call_test_func_with_wrapper(void (*funcPtr)(void)) { // Install a win32 structured exception handler around the test // function call so the VM can generate an error dump if needed. @@ -2727,7 +2726,6 @@ // Nothing to do. } } -#endif // Virtual Memory --- old/src/os/windows/vm/os_windows.hpp 2014-03-28 18:18:33.000000000 -0700 +++ new/src/os/windows/vm/os_windows.hpp 2014-03-28 18:18:33.000000000 -0700 @@ -97,9 +97,7 @@ static address fast_jni_accessor_wrapper(BasicType); #endif -#ifndef PRODUCT static void call_test_func_with_wrapper(void (*funcPtr)(void)); -#endif // filter function to ignore faults on serializations page static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e); --- old/src/os/windows/vm/os_windows.inline.hpp 2014-03-28 18:18:34.000000000 -0700 +++ new/src/os/windows/vm/os_windows.inline.hpp 2014-03-28 18:18:34.000000000 -0700 @@ -107,9 +107,7 @@ return ::close(fd); } -#ifndef PRODUCT - #define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) \ - os::win32::call_test_func_with_wrapper(f) -#endif +#define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) \ + os::win32::call_test_func_with_wrapper(f) #endif // OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP