# HG changeset patch # User cfang # Date 1250527682 25200 # Node ID c8e2135f7e30c71d43e20d6a3a9d5dc94993c605 # Parent 7c14587118b302037532641582e2985f221487b0 6829127: Deoptimization Failure on Specjvm98 _227_mtrt with -XX:+DeoptimizeALot since Hs11 b01 Summary: Make sure the control word is correct in deopt_blob after restore_result_registers Reviewed-by: kvn, never diff -r 7c14587118b3 -r c8e2135f7e30 src/cpu/x86/vm/sharedRuntime_x86_32.cpp --- a/src/cpu/x86/vm/sharedRuntime_x86_32.cpp Fri Aug 14 22:11:18 2009 -0700 +++ b/src/cpu/x86/vm/sharedRuntime_x86_32.cpp Mon Aug 17 09:48:02 2009 -0700 @@ -2381,7 +2381,7 @@ // Save everything in sight. - map = RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words); + map = RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words, false); // Normal deoptimization __ push(Deoptimization::Unpack_deopt); __ jmp(cont); @@ -2392,7 +2392,7 @@ // return address is the pc describes what bci to do re-execute at // No need to update map as each call to save_live_registers will produce identical oopmap - (void) RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words); + (void) RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words, false); __ push(Deoptimization::Unpack_reexecute); __ jmp(cont); @@ -2428,7 +2428,7 @@ // Save everything in sight. // No need to update map as each call to save_live_registers will produce identical oopmap - (void) RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words); + (void) RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words, false); // Now it is safe to overwrite any register @@ -2515,6 +2515,11 @@ RegisterSaver::restore_result_registers(masm); + // Non standard control word may be leaked out through a safepoint blob, and we can + // deopt at a poll point with the non standard control word. However, we should make + // sure the control word is correct after restore_result_registers. + __ fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std())); + // All of the register save area has been popped of the stack. Only the // return address remains.