--- old/src/cpu/x86/vm/sharedRuntime_x86_32.cpp 2017-04-10 17:30:01.103476700 -0700 +++ new/src/cpu/x86/vm/sharedRuntime_x86_32.cpp 2017-04-10 17:30:00.323476700 -0700 @@ -41,6 +41,7 @@ #ifdef COMPILER2 #include "opto/runtime.hpp" #endif +#include "vm_version_x86.hpp" #define __ masm-> @@ -120,8 +121,8 @@ int zmm_bytes = num_xmm_regs * 32; #ifdef COMPILER2 if (save_vectors) { - assert(UseAVX > 0, "up to 512bit vectors are supported with EVEX"); - assert(MaxVectorSize <= 64, "up to 512bit vectors are supported now"); + assert(UseAVX > 0, "Vectors larger than 16 byte long are supported only with AVX"); + assert(MaxVectorSize <= 64, "Only up to 64 byte long vectors are supported"); // Save upper half of YMM registers int vect_bytes = ymm_bytes; if (UseAVX > 2) { @@ -219,6 +220,9 @@ } } } + if (VM_Version::supports_avx()) { + __ vzeroupper(); + } // Set an oopmap for the call site. This oopmap will map all // oop-registers and debug-info registers as callee-saved. This @@ -269,8 +273,8 @@ int additional_frame_bytes = 0; #ifdef COMPILER2 if (restore_vectors) { - assert(UseAVX > 0, "up to 512bit vectors are supported with EVEX"); - assert(MaxVectorSize <= 64, "up to 512bit vectors are supported now"); + assert(UseAVX > 0, "Vectors larger than 16 byte long are supported only with AVX"); + assert(MaxVectorSize <= 64, "Only up to 64 byte long vectors are supported"); // Save upper half of YMM registers additional_frame_bytes = ymm_bytes; if (UseAVX > 2) { @@ -285,6 +289,10 @@ int off = xmm0_off; int delta = xmm1_off - off; + if (VM_Version::supports_avx()) { + __ vzeroupper(); + } + if (UseSSE == 1) { // Restore XMM registers assert(additional_frame_bytes == 0, ""); @@ -2123,6 +2131,9 @@ // preserved and correspond to the bcp/locals pointers. So we do a runtime call // by hand. // + if (VM_Version::supports_avx()) { + __ vzeroupper(); + } save_native_result(masm, ret_type, stack_slots); __ push(thread); if (!is_critical_native) { @@ -2309,7 +2320,9 @@ __ bind(slow_path_unlock); // Slow path unlock - + if (VM_Version::supports_avx()) { + __ vzeroupper(); + } if (ret_type == T_FLOAT || ret_type == T_DOUBLE ) { save_native_result(masm, ret_type, stack_slots); } @@ -2352,6 +2365,9 @@ // SLOW PATH Reguard the stack if needed __ bind(reguard); + if (VM_Version::supports_avx()) { + __ vzeroupper(); + } save_native_result(masm, ret_type, stack_slots); { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::reguard_yellow_pages)));