changeset 23040:a5685fe52cbf

Merge
author poonam
date Fri, 22 May 2015 13:41:35 +0000
parents 9904bb920313 (current diff) 74472adaf90d (diff)
children 347744b2cafe
files
diffstat 7 files changed, 37 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Jul 14 10:50:20 2014 +0200
+++ b/.hgtags	Fri May 22 13:41:35 2015 +0000
@@ -642,3 +642,5 @@
 4187dc92e90b16b4097627b8af4f5e6e63f3b497 hs25.60-b15
 b99f1bf208f385277b03a985d35b6614b4095f3e jdk8u60-b15
 f5800068c61d0627c14e99836e9ce5cf0ef00075 hs25.60-b16
+ab2353694ea7fd4907c5c88b8334f8feaafca8c7 jdk8u60-b16
+5efc25c367164b6856554b0d625f3c422fdf9558 hs25.60-b17
--- a/make/hotspot_version	Mon Jul 14 10:50:20 2014 +0200
+++ b/make/hotspot_version	Fri May 22 13:41:35 2015 +0000
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=25
 HS_MINOR_VER=60
-HS_BUILD_NUMBER=17
+HS_BUILD_NUMBER=18
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=8
--- a/src/share/vm/oops/instanceKlass.cpp	Mon Jul 14 10:50:20 2014 +0200
+++ b/src/share/vm/oops/instanceKlass.cpp	Fri May 22 13:41:35 2015 +0000
@@ -50,6 +50,7 @@
 #include "prims/jvmtiExport.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "prims/jvmtiRedefineClasses.hpp"
+#include "prims/jvmtiThreadState.hpp"
 #include "prims/methodComparator.hpp"
 #include "runtime/fieldDescriptor.hpp"
 #include "runtime/handles.inline.hpp"
@@ -928,10 +929,16 @@
     // Step 10 and 11
     Handle e(THREAD, PENDING_EXCEPTION);
     CLEAR_PENDING_EXCEPTION;
+    // JVMTI has already reported the pending exception
+    // JVMTI internal flag reset is needed in order to report ExceptionInInitializerError
+    JvmtiExport::clear_detected_exception((JavaThread*)THREAD);
     {
       EXCEPTION_MARK;
       this_oop->set_initialization_state_and_notify(initialization_error, THREAD);
       CLEAR_PENDING_EXCEPTION;   // ignore any exception thrown, class initialization error is thrown below
+      // JVMTI has already reported the pending exception
+      // JVMTI internal flag reset is needed in order to report ExceptionInInitializerError
+      JvmtiExport::clear_detected_exception((JavaThread*)THREAD);
     }
     DTRACE_CLASSINIT_PROBE_WAIT(error, InstanceKlass::cast(this_oop()), -1,wait);
     if (e->is_a(SystemDictionary::Error_klass())) {
--- a/src/share/vm/prims/jvm.cpp	Mon Jul 14 10:50:20 2014 +0200
+++ b/src/share/vm/prims/jvm.cpp	Fri May 22 13:41:35 2015 +0000
@@ -1372,7 +1372,11 @@
   if (HAS_PENDING_EXCEPTION) {
     pending_exception = Handle(THREAD, PENDING_EXCEPTION);
     CLEAR_PENDING_EXCEPTION;
-
+    // JVMTI has already reported the pending exception
+    // JVMTI internal flag reset is needed in order to report PrivilegedActionException
+    if (THREAD->is_Java_thread()) {
+      JvmtiExport::clear_detected_exception((JavaThread*) THREAD);
+    }
     if ( pending_exception->is_a(SystemDictionary::Exception_klass()) &&
         !pending_exception->is_a(SystemDictionary::RuntimeException_klass())) {
       // Throw a java.security.PrivilegedActionException(Exception e) exception
--- a/src/share/vm/prims/jvmtiExport.cpp	Mon Jul 14 10:50:20 2014 +0200
+++ b/src/share/vm/prims/jvmtiExport.cpp	Fri May 22 13:41:35 2015 +0000
@@ -2163,6 +2163,15 @@
   }
 }
 
+void JvmtiExport::clear_detected_exception(JavaThread* thread) {
+  assert(JavaThread::current() == thread, "thread is not current");
+
+  JvmtiThreadState* state = thread->jvmti_thread_state();
+  if (state != NULL) {
+    state->clear_exception_detected();
+  }
+}
+
 void JvmtiExport::oops_do(OopClosure* f) {
   JvmtiCurrentBreakpoints::oops_do(f);
   JvmtiVMObjectAllocEventCollector::oops_do_for_all_threads(f);
--- a/src/share/vm/prims/jvmtiExport.hpp	Mon Jul 14 10:50:20 2014 +0200
+++ b/src/share/vm/prims/jvmtiExport.hpp	Fri May 22 13:41:35 2015 +0000
@@ -363,6 +363,7 @@
   }
 
   static void cleanup_thread             (JavaThread* thread) NOT_JVMTI_RETURN;
+  static void clear_detected_exception   (JavaThread* thread) NOT_JVMTI_RETURN;
 
   static void oops_do(OopClosure* f) NOT_JVMTI_RETURN;
   static void weak_oops_do(BoolObjectClosure* b, OopClosure* f) NOT_JVMTI_RETURN;
--- a/src/share/vm/runtime/reflection.cpp	Mon Jul 14 10:50:20 2014 +0200
+++ b/src/share/vm/runtime/reflection.cpp	Fri May 22 13:41:35 2015 +0000
@@ -36,6 +36,7 @@
 #include "oops/objArrayKlass.hpp"
 #include "oops/objArrayOop.hpp"
 #include "prims/jvm.h"
+#include "prims/jvmtiExport.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
@@ -942,6 +943,11 @@
           // Method resolution threw an exception; wrap it in an InvocationTargetException
             oop resolution_exception = PENDING_EXCEPTION;
             CLEAR_PENDING_EXCEPTION;
+            // JVMTI has already reported the pending exception
+            // JVMTI internal flag reset is needed in order to report InvocationTargetException
+            if (THREAD->is_Java_thread()) {
+              JvmtiExport::clear_detected_exception((JavaThread*) THREAD);
+            }
             JavaCallArguments args(Handle(THREAD, resolution_exception));
             THROW_ARG_0(vmSymbols::java_lang_reflect_InvocationTargetException(),
                 vmSymbols::throwable_void_signature(),
@@ -1074,6 +1080,12 @@
     // Method threw an exception; wrap it in an InvocationTargetException
     oop target_exception = PENDING_EXCEPTION;
     CLEAR_PENDING_EXCEPTION;
+    // JVMTI has already reported the pending exception
+    // JVMTI internal flag reset is needed in order to report InvocationTargetException
+    if (THREAD->is_Java_thread()) {
+      JvmtiExport::clear_detected_exception((JavaThread*) THREAD);
+    }
+
     JavaCallArguments args(Handle(THREAD, target_exception));
     THROW_ARG_0(vmSymbols::java_lang_reflect_InvocationTargetException(),
                 vmSymbols::throwable_void_signature(),