--- old/src/share/vm/prims/jvmtiRedefineClasses.cpp Mon Feb 13 17:53:10 2017 +++ new/src/share/vm/prims/jvmtiRedefineClasses.cpp Mon Feb 13 17:53:09 2017 @@ -42,6 +42,7 @@ #include "runtime/deoptimization.hpp" #include "runtime/relocator.hpp" #include "utilities/bitMap.inline.hpp" +#include "utilities/events.hpp" PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC @@ -172,6 +173,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. @@ -4096,6 +4100,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() @@ -4240,3 +4251,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()); + } +}