Search in sources :

Example 11 with J9ObjectMonitorPointer

use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectMonitorPointer in project openj9 by eclipse.

the class CheckMonitorTable method print.

@Override
public void print() {
    try {
        VoidPointer monitorTableList = VoidPointer.cast(getJavaVM().monitorTableList());
        GCMonitorReferenceIterator monitorReferenceIterator = GCMonitorReferenceIterator.from();
        MonitorTable previousMonitorTable = null;
        ScanFormatter formatter = new ScanFormatter(this, "MonitorTableList", monitorTableList);
        while (monitorReferenceIterator.hasNext()) {
            J9ObjectMonitorPointer objectMonitor = monitorReferenceIterator.next();
            MonitorTable currentMonitorTable = monitorReferenceIterator.currentMonitorTable();
            if (!currentMonitorTable.equals(previousMonitorTable)) {
                if (null != previousMonitorTable) {
                    formatter.endSection();
                }
                formatter.section("MonitorTable", currentMonitorTable.getMonitorTableListEntryPointer());
            }
            J9ThreadAbstractMonitorPointer monitor = J9ThreadAbstractMonitorPointer.cast(objectMonitor.monitor());
            formatter.entry(VoidPointer.cast(monitor.userData()));
            previousMonitorTable = currentMonitorTable;
        }
        if (null != previousMonitorTable) {
            formatter.endSection();
        }
        formatter.end("MonitorTableList", monitorTableList);
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) J9ObjectMonitorPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectMonitorPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) GCMonitorReferenceIterator(com.ibm.j9ddr.vm29.j9.gc.GCMonitorReferenceIterator) MonitorTable(com.ibm.j9ddr.vm29.j9.MonitorTable) J9ThreadAbstractMonitorPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ThreadAbstractMonitorPointer)

Aggregations

CorruptDataException (com.ibm.j9ddr.CorruptDataException)9 J9ObjectMonitorPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectMonitorPointer)8 J9ThreadAbstractMonitorPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ThreadAbstractMonitorPointer)5 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)4 MonitorTable (com.ibm.j9ddr.vm29.j9.MonitorTable)4 MonitorTableListIterator (com.ibm.j9ddr.vm29.j9.MonitorTableListIterator)3 ObjectMonitor (com.ibm.j9ddr.vm29.j9.ObjectMonitor)2 GCMonitorReferenceIterator (com.ibm.j9ddr.vm29.j9.gc.GCMonitorReferenceIterator)2 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)2 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)2 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)1 J9ThreadMonitorPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ThreadMonitorPointer)1 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)1 U32 (com.ibm.j9ddr.vm29.types.U32)1 HashSet (java.util.HashSet)1