Search in sources :

Example 6 with MarkedObject

use of com.ibm.j9ddr.vm29.j9.gc.GCHeapMap.MarkedObject in project openj9 by eclipse.

the class MarkMapCommand method markBits.

protected void markBits(String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
    try {
        long address = CommandUtils.parsePointer(args[1], J9BuildFlags.env_data64);
        J9ObjectPointer object = J9ObjectPointer.cast(address);
        J9ObjectPointer base = J9ObjectPointer.cast(address).untag(markMap.getPageSize(object) - 1);
        J9ObjectPointer top = base.addOffset(markMap.getPageSize(object));
        MarkedObject[] result = markMap.queryRange(base, top);
        if (result.length > 0) {
            if (result[0].wasRelocated()) {
                out.format("Mark bits for the compacted range %s -> %s: !j9x %s\n", base.getHexAddress(), top.getHexAddress(), result[0].markBitsSlot.getHexAddress());
            } else {
                out.format("Mark bits for the range %s -> %s: !j9x %s\n", base.getHexAddress(), top.getHexAddress(), result[0].markBitsSlot.getHexAddress());
            }
        } else {
            /* Either outside the heap, or just nothing there */
            try {
                UDATA[] indexAndMask = markMap.getSlotIndexAndMask(base);
                UDATAPointer markBitsSlot = markMap.getHeapMapBits().add(indexAndMask[0]);
                out.format("Mark bits for the range %s -> %s: !j9x %s\n", base.getHexAddress(), top.getHexAddress(), markBitsSlot.getHexAddress());
            } catch (IllegalArgumentException ex) {
                out.format("Object %s is not in the heap\n", object.getHexAddress());
            }
        }
    } catch (CorruptDataException e) {
        throw new DDRInteractiveCommandException(e);
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) UDATAPointer(com.ibm.j9ddr.vm29.pointer.UDATAPointer) DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) MarkedObject(com.ibm.j9ddr.vm29.j9.gc.GCHeapMap.MarkedObject) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 7 with MarkedObject

use of com.ibm.j9ddr.vm29.j9.gc.GCHeapMap.MarkedObject in project openj9 by eclipse.

the class MarkMapCommand method scanRange.

protected void scanRange(String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
    try {
        long baseAddress = CommandUtils.parsePointer(args[1], J9BuildFlags.env_data64);
        long topAddress = CommandUtils.parsePointer(args[2], J9BuildFlags.env_data64);
        J9ObjectPointer base = J9ObjectPointer.cast(baseAddress);
        J9ObjectPointer top = J9ObjectPointer.cast(topAddress);
        MarkedObject[] results = markMap.queryRange(base, top);
        reportResults(base, top, results, out);
    } catch (CorruptDataException e) {
        throw new DDRInteractiveCommandException(e);
    }
}
Also used : DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) MarkedObject(com.ibm.j9ddr.vm29.j9.gc.GCHeapMap.MarkedObject) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Aggregations

J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)7 CorruptDataException (com.ibm.j9ddr.CorruptDataException)5 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)5 MarkedObject (com.ibm.j9ddr.vm29.j9.gc.GCHeapMap.MarkedObject)5 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)3 UDATA (com.ibm.j9ddr.vm29.types.UDATA)3 ArrayList (java.util.ArrayList)2