--- old/src/hotspot/share/runtime/vframe.cpp 2019-12-11 14:56:19.000000000 -0500 +++ new/src/hotspot/share/runtime/vframe.cpp 2019-12-11 14:56:19.000000000 -0500 @@ -122,6 +122,9 @@ if (mons->is_empty()) return result; bool found_first_monitor = false; + // For all of the javaVFrame::locked_monitors()() call sites, we + // are either at a safepoint or the calling thread is operating + // on itself so this ObjectMonitorHandle is not strictly necessary. ObjectMonitorHandle omh; ObjectMonitor *waiting_monitor = thread()->current_waiting_monitor(&omh); ObjectMonitor *pending_monitor = NULL; @@ -235,6 +238,8 @@ // an inflated monitor that is first on the monitor list in // the first frame can block us on a monitor enter. markWord mark = monitor->owner()->mark(); + // The calling thread is operating on itself so this + // ObjectMonitorHandle is not strictly necessary. ObjectMonitorHandle omh; if (mark.has_monitor() && ( // we have marked ourself as pending on this monitor