public ElementInfo getBlockedObject(ThreadInfo th, boolean isBeforeCall) { int objref; ElementInfo ei = null; if (isSynchronized()) { if (isStatic()) { objref = ci.getClassObjectRef(); } else { // NOTE 'inMethod' doesn't work for natives, because th.getThis() // pulls 'this' from the stack frame, which we don't have (and don't need) // for natives objref = isBeforeCall ? th.getCalleeThis(this) : th.getThis(); } ei = th.getElementInfo(objref); assert (ei != null) : ("inconsistent stack, no object or class ref: " + getCompleteName() + " (" + objref + ")"); } return ei; }