--- old/src/hotspot/share/runtime/vframe.cpp 2020-07-21 14:10:33.822694636 +0200 +++ new/src/hotspot/share/runtime/vframe.cpp 2020-07-21 14:10:33.702692844 +0200 @@ -38,6 +38,7 @@ #include "oops/oop.inline.hpp" #include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" +#include "runtime/monitorInfo.inline.hpp" #include "runtime/objectMonitor.hpp" #include "runtime/objectMonitor.inline.hpp" #include "runtime/signature.hpp" @@ -136,12 +137,12 @@ for (int index = (mons->length()-1); index >= 0; index--) { MonitorInfo* monitor = mons->at(index); if (monitor->eliminated() && is_compiled_frame()) continue; // skip eliminated monitor - oop obj = monitor->owner(); - if (obj == NULL) continue; // skip unowned monitor + Handle obj_h = monitor->owner_h(); + if (obj_h.is_null()) continue; // skip unowned monitor // // Skip the monitor that the thread is blocked to enter or waiting on // - if (!found_first_monitor && (obj == pending_obj || obj == waiting_obj)) { + if (!found_first_monitor && (obj_h == pending_obj || obj_h == waiting_obj)) { continue; } found_first_monitor = true; @@ -165,6 +166,7 @@ void javaVFrame::print_lock_info_on(outputStream* st, int frame_count) { Thread* THREAD = Thread::current(); ResourceMark rm(THREAD); + HandleMark hm(THREAD); // If this is the first frame and it is java.lang.Object.wait(...) // then print out the receiver. Locals are not always available, @@ -219,14 +221,14 @@ Klass* k = java_lang_Class::as_Klass(monitor->owner_klass()); st->print("\t- eliminated (a %s)", k->external_name()); } else { - Handle obj(THREAD, monitor->owner()); - if (obj() != NULL) { - print_locked_object_class_name(st, obj, "eliminated"); + Handle obj_h = monitor->owner_h(); + if (obj_h.not_null()) { + print_locked_object_class_name(st, obj_h, "eliminated"); } } continue; } - if (monitor->owner() != NULL) { + if (monitor->owner_h().not_null()) { // the monitor is associated with an object, i.e., it is locked const char *lock_state = "locked"; // assume we have the monitor locked @@ -248,7 +250,7 @@ lock_state = "waiting to lock"; } } - print_locked_object_class_name(st, Handle(THREAD, monitor->owner()), lock_state); + print_locked_object_class_name(st, monitor->owner_h(), lock_state); found_first_monitor = true; } @@ -612,6 +614,8 @@ void javaVFrame::print() { ResourceMark rm; + HandleMark hm; + vframe::print(); tty->print("\t"); method()->print_value();