hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp
changeset 31237 f166af10646e
parent 31046 d01ad7a0ecb0
parent 31234 48000028382c
child 31353 cd33628db166
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Thu Jun 18 13:18:12 2015 -0700
@@ -43,6 +43,7 @@
 #include "runtime/deoptimization.hpp"
 #include "runtime/relocator.hpp"
 #include "utilities/bitMap.inline.hpp"
+#include "utilities/events.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
@@ -174,6 +175,9 @@
   // Free os::malloc allocated memory.
   os::free(_scratch_classes);
 
+  // Reset the_class_oop to null for error printing.
+  _the_class_oop = NULL;
+
   if (RC_TRACE_ENABLED(0x00000004)) {
     // Used to have separate timers for "doit" and "all", but the timer
     // overhead skewed the measurements.
@@ -4105,6 +4109,13 @@
     java_lang_Class::classRedefinedCount(the_class_mirror),
     os::available_memory() >> 10));
 
+  {
+    ResourceMark rm(THREAD);
+    Events::log_redefinition(THREAD, "redefined class name=%s, count=%d",
+                             the_class->external_name(),
+                             java_lang_Class::classRedefinedCount(the_class_mirror));
+
+  }
   RC_TIMER_STOP(_timer_rsc_phase2);
 } // end redefine_single_class()
 
@@ -4249,3 +4260,11 @@
     tty->cr();
   }
 }
+
+void VM_RedefineClasses::print_on_error(outputStream* st) const {
+  VM_Operation::print_on_error(st);
+  if (_the_class_oop != NULL) {
+    ResourceMark rm;
+    st->print_cr(", redefining class %s", _the_class_oop->external_name());
+  }
+}