1.1 --- a/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp Tue Jun 01 11:48:33 2010 -0700 1.2 +++ b/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp Wed Jun 02 22:45:42 2010 -0700 1.3 @@ -679,8 +679,15 @@ 1.4 __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address), 1.5 G2_thread, Oissuing_pc->after_save()); 1.6 __ verify_not_null_oop(Oexception->after_save()); 1.7 - __ jmp(O0, 0); 1.8 - __ delayed()->restore(); 1.9 + 1.10 + // Restore SP from L7 if the exception PC is a MethodHandle call site. 1.11 + __ mov(O0, G5); // Save the target address. 1.12 + __ lduw(Address(G2_thread, JavaThread::is_method_handle_return_offset()), L0); 1.13 + __ tst(L0); // Condition codes are preserved over the restore. 1.14 + __ restore(); 1.15 + 1.16 + __ jmp(G5, 0); 1.17 + __ delayed()->movcc(Assembler::notZero, false, Assembler::icc, L7_mh_SP_save, SP); // Restore SP if required. 1.18 } 1.19 break; 1.20