Search in sources :

Example 6 with VoidPointer

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

the class GCArrayletObjectModelBase_V1 method getElementAddress.

@Override
public VoidPointer getElementAddress(J9IndexableObjectPointer array, int elementIndex, int elementSize) throws CorruptDataException {
    boolean isInlineContiguous = isInlineContiguousArraylet(array);
    UDATA byteOffsetIntoData = new UDATA(elementIndex * (long) elementSize);
    if (isInlineContiguous) {
        return VoidPointer.cast(getDataPointerForContiguous(array).addOffset(byteOffsetIntoData));
    } else {
        ObjectReferencePointer arrayoid = getArrayoidPointer(array);
        UDATA arrayletIndex = byteOffsetIntoData.rightShift(arrayletLeafLogSize);
        VoidPointer arrayletLeafBaseAddress = VoidPointer.cast(arrayoid.at(arrayletIndex));
        if (arrayletLeafBaseAddress.isNull()) {
            /* this can happen if the arraylet wasn't fully initialized */
            throw new NoSuchElementException("Arraylet leaf not yet initialized");
        }
        UDATA indexIntoArraylet = byteOffsetIntoData.bitAnd(arrayletLeafSizeMask);
        return arrayletLeafBaseAddress.addOffset(indexIntoArraylet);
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) ObjectReferencePointer(com.ibm.j9ddr.vm29.pointer.ObjectReferencePointer) NoSuchElementException(java.util.NoSuchElementException)

Example 7 with VoidPointer

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

the class GCClassLocalInterfaceIterator method nextAddress.

public VoidPointer nextAddress() {
    if (hasNext()) {
        try {
            VoidPointer next = VoidPointer.cast(iTable.interfaceClassEA());
            iTable = iTable.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)

Example 8 with VoidPointer

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

the class GCCardTable method cleanRange.

public void cleanRange(U8Pointer lowCard, U8Pointer highCard, GCCardCleaner cardCleaner) throws CorruptDataException {
    U8Pointer thisCard = lowCard;
    U8Pointer endCard = highCard;
    while (thisCard.lt(endCard)) {
        try {
            U8 card = thisCard.at(0);
            if (!card.eq(J9ModroncoreConstants.CARD_CLEAN)) {
                VoidPointer lowAddress = cardAddrToHeapAddr(thisCard);
                VoidPointer highAddress = lowAddress.addOffset(J9ModroncoreConstants.CARD_SIZE);
                cardCleaner.clean(lowAddress, highAddress, thisCard);
            }
        } catch (CorruptDataException cde) {
            raiseCorruptDataEvent("Corrupt Card", cde, false);
        }
        thisCard = thisCard.add(1);
    }
}
Also used : U8(com.ibm.j9ddr.vm29.types.U8) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 9 with VoidPointer

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

the class GCMixedObjectIterator_V1 method nextAddress.

public VoidPointer nextAddress() {
    try {
        if (hasNext()) {
            if (object != null && includeClassSlot) {
                includeClassSlot = false;
                return VoidPointer.cast(J9ObjectHelper.clazz(object).classObjectEA());
            }
            VoidPointer next = VoidPointer.cast(data.add(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 : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) NoSuchElementException(java.util.NoSuchElementException)

Example 10 with VoidPointer

use of com.ibm.j9ddr.vm29.pointer.VoidPointer 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

VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)48 CorruptDataException (com.ibm.j9ddr.CorruptDataException)37 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)15 NoSuchElementException (java.util.NoSuchElementException)13 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)9 UDATA (com.ibm.j9ddr.vm29.types.UDATA)9 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)5 GCVMThreadListIterator (com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator)5 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)5 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)4 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)3 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)3 CorruptData (com.ibm.dtfj.image.CorruptData)2 JavaObject (com.ibm.dtfj.java.JavaObject)2 J9DDRCorruptData (com.ibm.j9ddr.view.dtfj.image.J9DDRCorruptData)2 MonitorTable (com.ibm.j9ddr.vm29.j9.MonitorTable)2 GCJNIGlobalReferenceIterator (com.ibm.j9ddr.vm29.j9.gc.GCJNIGlobalReferenceIterator)2 GCJNIWeakGlobalReferenceIterator (com.ibm.j9ddr.vm29.j9.gc.GCJNIWeakGlobalReferenceIterator)2 GCObjectIterator (com.ibm.j9ddr.vm29.j9.gc.GCObjectIterator)2 BaseStackWalkerCallbacks (com.ibm.j9ddr.vm29.j9.stackwalker.BaseStackWalkerCallbacks)2