Search in sources :

Example 26 with CorruptDataException

use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.

the class GCMixedObjectIterator_V1 method next.

@Override
public J9ObjectPointer next() {
    try {
        if (hasNext()) {
            if (object != null && includeClassSlot) {
                includeClassSlot = false;
                return J9ObjectHelper.clazz(object).classObject();
            }
            J9ObjectPointer next = J9ObjectPointer.cast(data.at(scanIndex));
            scanIndex++;
            return next;
        } else {
            throw new NoSuchElementException("There are no more items available through this iterator");
        }
    } catch (CorruptDataException e) {
        // can try to recover from this
        raiseCorruptDataEvent("Error getting next item", e, false);
        return null;
    }
}
Also used : CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer) NoSuchElementException(java.util.NoSuchElementException)

Example 27 with CorruptDataException

use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.

the class GCHeapRegionIterator method hasNext.

public boolean hasNext() {
    try {
        if (null != currentRegion) {
            return true;
        }
        while ((null != _auxRegion) || (null != _tableRegion)) {
            MM_HeapRegionDescriptorPointer region = null;
            /* we need to return these in-order */
            if ((null != _auxRegion) && ((null == _tableRegion) || (_auxRegion.lt(_tableRegion)))) {
                region = _auxRegion;
                _auxRegion = getNextAuxiliaryRegion(_auxRegion);
            } else if (null != _tableRegion) {
                region = _tableRegion;
                _tableRegion = getNextTableRegion(_tableRegion);
            } else {
                break;
            }
            if (shouldIncludeRegion(region)) {
                currentRegion = GCHeapRegionDescriptor.fromHeapRegionDescriptor(region);
                return true;
            }
        }
        return false;
    } catch (CorruptDataException cde) {
        // can try to recover from this
        raiseCorruptDataEvent("Error getting next item", cde, false);
        return false;
    }
}
Also used : MM_HeapRegionDescriptorPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionDescriptorPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 28 with CorruptDataException

use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.

the class GCMarkMapStandard method getPageSize.

@Override
public int getPageSize(J9ObjectPointer object) {
    int result = super.getPageSize(object);
    try {
        if ((object != null) && object.gte(_heapBase) && object.lt(_heapTop)) {
            UDATA heapBaseOffset = UDATA.cast(object).sub(UDATA.cast(_heapBase));
            // pairs of UDATA, so *2
            UDATA pageIndex = heapBaseOffset.div(MM_CompactScheme.sizeof_page).mult(2);
            UDATA compactTableEntry_addr = _heapMapBits.at(pageIndex);
            if (compactTableEntry_addr.allBitsIn(3)) {
                result = (int) MM_CompactScheme.sizeof_page;
            }
        }
    } catch (CorruptDataException cde) {
    // Ignore this particular error -- surely the calling code will hit it
    }
    return result;
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 29 with CorruptDataException

use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.

the class GCVMThreadListIterator method next.

public J9VMThreadPointer next() {
    try {
        if (hasNext()) {
            J9VMThreadPointer next;
            next = currentVMThread;
            currentVMThread = currentVMThread.linkNext();
            if (currentVMThread.equals(initialVMThread)) {
                currentVMThread = J9VMThreadPointer.NULL;
            }
            return next;
        } else {
            throw new NoSuchElementException("There are no more items available through this iterator");
        }
    } catch (CorruptDataException cde) {
        // link to next vm thread is broken, terminate iterator
        currentVMThread = J9VMThreadPointer.NULL;
        raiseCorruptDataEvent("Error getting next item", cde, false);
        return null;
    }
}
Also used : J9VMThreadPointer(com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) NoSuchElementException(java.util.NoSuchElementException)

Example 30 with CorruptDataException

use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.

the class GCVMThreadMonitorRecordSlotIterator method nextAddress.

public VoidPointer nextAddress() {
    if (hasNext()) {
        try {
            VoidPointer next;
            if (monitorRecord.notNull()) {
                next = VoidPointer.cast(monitorRecord.objectEA());
                monitorRecord = monitorRecord.next();
            } else {
                next = VoidPointer.cast(jniMonitorRecord.objectEA());
                jniMonitorRecord = jniMonitorRecord.next();
            }
            return next;
        } catch (CorruptDataException e) {
            // can try to recover from this
            raiseCorruptDataEvent("Error getting next item", e, false);
            return null;
        }
    } else {
        throw new NoSuchElementException("There are no more items available through this iterator");
    }
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) NoSuchElementException(java.util.NoSuchElementException)

Aggregations

CorruptDataException (com.ibm.j9ddr.CorruptDataException)221 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)81 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)46 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)41 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)33 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)30 NoSuchElementException (java.util.NoSuchElementException)28 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)25 UDATA (com.ibm.j9ddr.vm29.types.UDATA)20 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)17 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)15 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)11 J9MethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)9 J9ROMMethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer)9 ClassWalker (com.ibm.j9ddr.vm29.tools.ddrinteractive.ClassWalker)8 LinearDumper (com.ibm.j9ddr.vm29.tools.ddrinteractive.LinearDumper)8 PatternString (com.ibm.j9ddr.util.PatternString)7 GCVMThreadListIterator (com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator)7 ClassSegmentIterator (com.ibm.j9ddr.vm29.j9.walkers.ClassSegmentIterator)7 J9PoolPointer (com.ibm.j9ddr.vm29.pointer.generated.J9PoolPointer)7