--- old/src/cpu/x86/vm/stubGenerator_x86_64.cpp 2015-06-19 20:50:00.807937600 -0700 +++ new/src/cpu/x86/vm/stubGenerator_x86_64.cpp 2015-06-19 20:50:00.150937600 -0700 @@ -382,7 +382,12 @@ // restore regs belonging to calling function #ifdef _WIN64 - for (int i = 15; i >= 6; i--) { + int xmm_ub = 15; + if (UseAVX > 2) { + xmm_ub = 31; + } + // emit the restores for xmm regs + for (int i = 6; i <= xmm_ub; i++) { __ movdqu(as_XMMRegister(i), xmm_save(i)); } #endif