ObjectMonitor mon = myJavaThread.getCurrentWaitingMonitor();
if (mon == null) {
// thread is not doing an Object.wait() call
mon = myJavaThread.getCurrentPendingMonitor();
if (mon != null) {
OopHandle handle = mon.object();
// If obj == NULL, then ObjectMonitor is raw which doesn't count
// as contended for this API
return vm.objectMirror(vm.saObjectHeap().newOop(handle));
} else {
// no contended ObjectMonitor