changeset 9568:f64a3fec4e42

exception PC stored in thread is cleared when retrieving continuation for a return address
author Doug Simon <doug.simon@oracle.com>
date Mon, 06 May 2013 12:52:22 +0200
parents a8b4f26d8485
children d6bf345d58c1 a79e8020ad4b
files src/share/vm/runtime/sharedRuntime.cpp
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/sharedRuntime.cpp	Sun May 05 17:42:45 2013 +0200
+++ b/src/share/vm/runtime/sharedRuntime.cpp	Mon May 06 12:52:22 2013 +0200
@@ -484,6 +484,12 @@
   // Reset method handle flag.
   thread->set_is_method_handle_return(false);
 
+#ifdef GRAAL
+  // Graal's ExceptionHandlerStub expects the thread local exception PC to be clear
+  // and other exception handler continuations do not read it
+  thread->set_exception_pc(NULL);
+#endif
+
   // The fastest case first
   CodeBlob* blob = CodeCache::find_blob(return_address);
   nmethod* nm = (blob != NULL) ? blob->as_nmethod_or_null() : NULL;
@@ -493,10 +499,6 @@
     // native nmethods don't have exception handlers
     assert(!nm->is_native_method(), "no exception handler");
     assert(nm->header_begin() != nm->exception_begin(), "no exception handler");
-#ifdef GRAAL
-    // Graal's ExceptionHandlerStub expects the exception PC stored in the thread to be 0
-    thread->set_exception_pc(NULL);
-#endif
     if (nm->is_deopt_pc(return_address)) {
       return SharedRuntime::deopt_blob()->unpack_with_exception();
     } else {