< prev index next >
src/hotspot/share/runtime/vframe.cpp
Print this page
rev 57595 : v2.09a with 8235795, 8235931 and 8236035 extracted; rebased to jdk-14+28; merge with 8236035.patch.cr1; merge with 8235795.patch.cr1; merge with 8236035.patch.cr2; merge with 8235795.patch.cr2; merge with 8235795.patch.cr3.
*** 120,131 ****
GrowableArray<MonitorInfo*>* mons = monitors();
GrowableArray<MonitorInfo*>* result = new GrowableArray<MonitorInfo*>(mons->length());
if (mons->is_empty()) return result;
bool found_first_monitor = false;
! ObjectMonitor *pending_monitor = thread()->current_pending_monitor();
! ObjectMonitor *waiting_monitor = thread()->current_waiting_monitor();
oop pending_obj = (pending_monitor != NULL ? (oop) pending_monitor->object() : (oop) NULL);
oop waiting_obj = (waiting_monitor != NULL ? (oop) waiting_monitor->object() : (oop) NULL);
for (int index = (mons->length()-1); index >= 0; index--) {
MonitorInfo* monitor = mons->at(index);
--- 120,138 ----
GrowableArray<MonitorInfo*>* mons = monitors();
GrowableArray<MonitorInfo*>* result = new GrowableArray<MonitorInfo*>(mons->length());
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;
! if (waiting_monitor == NULL) {
! pending_monitor = thread()->current_pending_monitor(&omh);
! }
oop pending_obj = (pending_monitor != NULL ? (oop) pending_monitor->object() : (oop) NULL);
oop waiting_obj = (waiting_monitor != NULL ? (oop) waiting_monitor->object() : (oop) NULL);
for (int index = (mons->length()-1); index >= 0; index--) {
MonitorInfo* monitor = mons->at(index);
*** 229,241 ****
// monitor before, then we need to see if we have completed
// the lock or if we are blocked trying to acquire it. Only
// 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();
if (mark.has_monitor() &&
( // we have marked ourself as pending on this monitor
! mark.monitor() == thread()->current_pending_monitor() ||
// we are not the owner of this monitor
!mark.monitor()->is_entered(thread())
)) {
lock_state = "waiting to lock";
}
--- 236,251 ----
// monitor before, then we need to see if we have completed
// the lock or if we are blocked trying to acquire it. Only
// 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
! mark.monitor() == thread()->current_pending_monitor(&omh) ||
// we are not the owner of this monitor
!mark.monitor()->is_entered(thread())
)) {
lock_state = "waiting to lock";
}
< prev index next >