use of com.ibm.j9ddr.vm29.pointer.generated.J9ThreadAbstractMonitorPointer in project openj9 by eclipse.
the class SimpleRootScanner method doMonitorLookupCacheSlot.
@Override
protected void doMonitorLookupCacheSlot(J9ObjectMonitorPointer slot, ObjectMonitorReferencePointer address) {
try {
J9ThreadAbstractMonitorPointer monitor = J9ThreadAbstractMonitorPointer.cast(slot.monitor());
doSlot(J9ObjectPointer.cast(monitor.userData()), VoidPointer.cast(monitor.userDataEA()));
} catch (CorruptDataException e) {
EventManager.raiseCorruptDataEvent("Errror accessing object slot from J9ObjectMonitorPointer: " + slot.getHexAddress(), e, false);
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ThreadAbstractMonitorPointer in project openj9 by eclipse.
the class MonitorsCommand method tablePrintHelper.
/**
* Helper to print monitor tables.
*
* @param filter
* @param builder
* @param objectMonitorPointer
* @return
* @throws DDRInteractiveCommandException
*/
private ObjectMonitor tablePrintHelper(FilterOptions filter, StringBuilder builder, J9ObjectMonitorPointer objectMonitorPointer) throws DDRInteractiveCommandException {
try {
J9ThreadMonitorPointer threadMonitorPointer = objectMonitorPointer.monitor();
J9ThreadAbstractMonitorPointer lock = J9ThreadAbstractMonitorPointer.cast(threadMonitorPointer);
if (lock.flags().allBitsIn(J9ThreadAbstractMonitor.J9THREAD_MONITOR_OBJECT)) {
if (!lock.userData().eq(0)) {
// this is an object monitor in the system monitor table
J9ObjectPointer obj = J9ObjectPointer.cast(lock.userData());
ObjectMonitor objMon = ObjectAccessBarrier.getMonitor(obj);
if (null != objMon) {
writeObjectMonitorToBuffer(filter, objMon, builder);
return objMon;
}
}
}
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
return null;
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ThreadAbstractMonitorPointer in project openj9 by eclipse.
the class CheckMonitorTable method check.
@Override
public void check() {
try {
GCMonitorReferenceIterator monitorReferenceIterator = GCMonitorReferenceIterator.from();
while (monitorReferenceIterator.hasNext()) {
J9ObjectMonitorPointer objectMonitor = monitorReferenceIterator.next();
J9ThreadAbstractMonitorPointer monitor = J9ThreadAbstractMonitorPointer.cast(objectMonitor.monitor());
PointerPointer slot = PointerPointer.cast(monitor.userDataEA());
if (_engine.checkSlotPool(slot, VoidPointer.cast(monitorReferenceIterator.currentMonitorTable().getJ9HashTablePointer())) != J9MODRON_SLOT_ITERATOR_OK) {
return;
}
}
} catch (CorruptDataException e) {
// TODO: handle exception
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ThreadAbstractMonitorPointer in project openj9 by eclipse.
the class SimpleRootScanner method doMonitorReference.
@Override
protected void doMonitorReference(J9ObjectMonitorPointer slot, VoidPointer address) {
try {
J9ThreadAbstractMonitorPointer monitor = J9ThreadAbstractMonitorPointer.cast(slot.monitor());
doSlot(J9ObjectPointer.cast(monitor.userData()), VoidPointer.cast(monitor.userDataEA()));
} catch (CorruptDataException e) {
EventManager.raiseCorruptDataEvent("Errror accessing object slot from J9ObjectMonitorPointer: " + slot.getHexAddress(), e, false);
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ThreadAbstractMonitorPointer in project openj9 by eclipse.
the class MonitorIterator method threadPoolHasNext.
private boolean threadPoolHasNext() throws CorruptDataException {
while ((current == null) && pool.notNull()) {
while (index < poolSize) {
J9ThreadMonitorPointer monitor = J9ThreadMonitorPointer.cast(poolEntries.add(index));
index++;
if (freeTag != monitor.count().longValue()) {
J9ThreadAbstractMonitorPointer lock = J9ThreadAbstractMonitorPointer.cast(monitor);
if (lock.flags().allBitsIn(J9ThreadAbstractMonitor.J9THREAD_MONITOR_OBJECT)) {
if (!lock.userData().eq(0)) {
// this is an object monitor in the system monitor table
J9ObjectPointer obj = J9ObjectPointer.cast(lock.userData());
ObjectMonitor objmon = ObjectAccessBarrier.getMonitor(obj);
// This check is to exclude flat object monitors. Flat object monitors are accounted for during the heap walk
if ((objmon == null) || !objmon.isInflated()) {
continue;
}
// return an object monitor
current = objmon;
}
} else {
// return a system monitor
current = monitor;
}
if (log.isLoggable(Level.FINE)) {
log.fine(String.format("Found monitor @ 0x%016x : %s", monitor.getAddress(), monitor.name().getCStringAtOffset(0)));
}
return true;
}
}
pool = pool.next();
if (pool.notNull()) {
index = 0;
poolEntries = pool.entriesEA();
}
}
return pool.notNull();
}
Aggregations