Search in sources :

Example 51 with J9ObjectPointer

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

the class GCPointerArrayIterator_V1 method next.

@Override
public J9ObjectPointer next() {
    try {
        if (hasNext()) {
            if (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 52 with J9ObjectPointer

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

the class GCObjectHeapIteratorSegregated_V1 method next.

public J9ObjectPointer next() {
    if (hasNext()) {
        J9ObjectPointer next = currentObject;
        currentObject = null;
        return next;
    } else {
        throw new NoSuchElementException("There are no more items available through this iterator");
    }
}
Also used : J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer) NoSuchElementException(java.util.NoSuchElementException)

Example 53 with J9ObjectPointer

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

the class MMObjectAccessBarrier_V1 method getOwnableSynchronizerLink.

@Override
public J9ObjectPointer getOwnableSynchronizerLink(J9ObjectPointer object) throws CorruptDataException {
    UDATA fieldOffset = getExtensions().accessBarrier()._ownableSynchronizerLinkOffset();
    J9ObjectPointer next = ObjectReferencePointer.cast(object.addOffset(fieldOffset)).at(0);
    if (object.equals(next)) {
        return J9ObjectPointer.NULL;
    }
    return next;
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 54 with J9ObjectPointer

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

the class MMObjectAccessBarrier_V1 method convertPointerFromToken.

/**
 * @see MMObjectAccessBarrier
 */
@Override
public J9ObjectPointer convertPointerFromToken(long token) {
    if (token == 0) {
        return J9ObjectPointer.NULL;
    }
    if (J9BuildFlags.gc_compressedPointers) {
        UDATA ref = new UDATA(token);
        ref = ref.leftShift(shift);
        return J9ObjectPointer.cast(ref);
    } else {
        return J9ObjectPointer.cast(token);
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Example 55 with J9ObjectPointer

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

the class HeapWalker method walk.

public void walk() {
    register(this);
    try {
        if (hasNextNoHandler()) {
            try {
                J9ObjectPointer object = heapIterator.next();
                doState(object);
                if (!hasNextNoHandler()) {
                    state = STATE_FINISHED;
                    doState(object);
                }
            } catch (CorruptDataException e) {
            /* CMVC 173382: Due to the corrupt data registration mechanism, we shouldn't
					 * take action in the event of CDE to prevent double reporting.
					 */
            }
        } else {
            throw new NoSuchElementException("The heap walk is complete");
        }
    } finally {
        unregister(this);
    }
}
Also used : CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer) NoSuchElementException(java.util.NoSuchElementException)

Aggregations

J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)76 CorruptDataException (com.ibm.j9ddr.CorruptDataException)48 UDATA (com.ibm.j9ddr.vm29.types.UDATA)22 NoSuchElementException (java.util.NoSuchElementException)18 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)17 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)16 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)12 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)7 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)6 ObjectMonitor (com.ibm.j9ddr.vm29.j9.ObjectMonitor)5 MarkedObject (com.ibm.j9ddr.vm29.j9.gc.GCHeapMap.MarkedObject)5 GCHeapRegionDescriptor (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor)5 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)5 GCObjectHeapIterator (com.ibm.j9ddr.vm29.j9.gc.GCObjectHeapIterator)4 GCObjectIterator (com.ibm.j9ddr.vm29.j9.gc.GCObjectIterator)4 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)4 ArrayList (java.util.ArrayList)4 J9ObjectFieldOffset (com.ibm.j9ddr.vm29.j9.J9ObjectFieldOffset)3 GCHeapRegionIterator (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionIterator)3 U32Pointer (com.ibm.j9ddr.vm29.pointer.U32Pointer)3