Search in sources :

Example 11 with VoidPointer

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

the class GCPointerArrayIterator_V1 method nextAddress.

public VoidPointer nextAddress() {
    try {
        if (hasNext()) {
            if (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 12 with VoidPointer

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

the class GCPointerArrayletIterator_V1 method nextAddress.

public VoidPointer nextAddress() {
    VoidPointer next = null;
    try {
        if (hasNext()) {
            if (includeClassSlot) {
                includeClassSlot = false;
                next = VoidPointer.cast(J9ObjectHelper.clazz(object).classObjectEA());
            } else {
                next = indexableObjectModel.getElementAddress(J9IndexableObjectPointer.cast(object), scanIndex, (int) ObjectReferencePointer.SIZEOF);
                scanIndex++;
            }
        } 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 next;
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) NoSuchElementException(java.util.NoSuchElementException)

Example 13 with VoidPointer

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

the class GCPointerArrayletIterator_V1 method next.

@Override
public J9ObjectPointer next() {
    J9ObjectPointer next = null;
    try {
        if (hasNext()) {
            if (includeClassSlot) {
                includeClassSlot = false;
                next = J9ObjectHelper.clazz(object).classObject();
            } else {
                VoidPointer elementAddress = indexableObjectModel.getElementAddress(J9IndexableObjectPointer.cast(object), scanIndex, (int) ObjectReferencePointer.SIZEOF);
                next = ObjectReferencePointer.cast(elementAddress).at(0);
                scanIndex++;
            }
        } 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 next;
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer) NoSuchElementException(java.util.NoSuchElementException)

Example 14 with VoidPointer

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

the class StackWalkerUtils method WALK_NAMED_INDIRECT_O_SLOT.

public static void WALK_NAMED_INDIRECT_O_SLOT(WalkState walkState, PointerPointer objectSlot, VoidPointer indirectSlot, String tag) throws CorruptDataException {
    UDATA value;
    value = UDATAPointer.cast(objectSlot).at(0);
    if (indirectSlot.notNull()) {
        swPrintf(walkState, 4, "\t\t{0}[{1} -> {2}] = {3}", (tag != null ? tag : "O-Slot"), indirectSlot.getHexAddress(), objectSlot.getHexAddress(), value.getHexValue());
    } else {
        swPrintf(walkState, 4, "\t\t{0}[{1}] = {2}", (tag != null ? tag : "O-Slot"), objectSlot.getHexAddress(), value.getHexValue());
    }
    walkState.callBacks.objectSlotWalkFunction(walkState.walkThread, walkState, objectSlot, VoidPointer.cast(objectSlot));
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Example 15 with VoidPointer

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

the class J9MemTagIterator method internalNext.

private J9MemTagPointer internalNext() {
    long result;
    this.isFooterCorrupted = false;
    /* Hunt for the header eyecatcher */
    do {
        result = DataType.getProcess().findPattern(headerEyecatcherBytes, UDATA.SIZEOF, currentSearchAddress);
        if (result == -1) {
            return null;
        }
        if (Addresses.greaterThan(result, topAddress)) {
            return null;
        }
        /* Move the current search address beyond the current result */
        currentSearchAddress = result + UDATA.SIZEOF;
        /* Address is in range - does it point to a valid block? */
        VoidPointer memoryBase = j9mem_get_memory_base(J9MemTagPointer.cast(result));
        try {
            IDATA corruption = j9mem_check_tags(VoidPointer.cast(memoryBase), headerEyecatcher, footerEyecatcher);
            if (corruption.allBitsIn(J9PORT_MEMTAG_NOT_A_TAG.longValue())) {
                /* This is not a memory tag */
                continue;
            }
            if (corruption.allBitsIn(J9PORT_MEMTAG_FOOTER_TAG_CORRUPTED.longValue()) || corruption.allBitsIn(J9PORT_MEMTAG_FOOTER_PADDING_CORRUPTED.longValue())) {
                /*
					 * A block with corrupted footer is accepted only and only if 
					 * we are dealing with freed memory. Therefore, following check is double check.
					 * If we are here, then it is freed memory is being looked for with the current algorithm. 
					 *	
					 */
                if (headerEyecatcher == J9MEMTAG_EYECATCHER_FREED_HEADER && footerEyecatcher == J9MEMTAG_EYECATCHER_FREED_FOOTER) {
                    this.isFooterCorrupted = true;
                    return J9MemTagPointer.cast(result);
                }
            }
        } catch (J9MemTagCheckError e) {
            /* Tag is readable, but corrupt */
            if (!lookingForFreedCallSites) {
                EventManager.raiseCorruptDataEvent("Corrupt memory section found", e, false);
            }
            /* Find the next section */
            continue;
        }
        return J9MemTagPointer.cast(result);
    } while (true);
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) IDATA(com.ibm.j9ddr.vm29.types.IDATA)

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