--- a/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp Tue Jun 01 11:48:33 2010 -0700
+++ b/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp Wed Jun 02 22:45:42 2010 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -116,6 +116,11 @@
__ mov(O0, G3_scratch); // Move handler address to temp
__ restore();
+ // Restore SP from L7 if the exception PC is a MethodHandle call site.
+ __ lduw(Address(G2_thread, JavaThread::is_method_handle_return_offset()), O7);
+ __ tst(O7);
+ __ movcc(Assembler::notZero, false, Assembler::icc, L7_mh_SP_save, SP);
+
// G3_scratch contains handler address
// Since this may be the deopt blob we must set O7 to look like we returned
// from the original pc that threw the exception