Search in sources :

Example 46 with J9ObjectPointer

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

the class GCHeapMap method getSlotIndexAndMask.

/**
 * Return the index into the heap map bits array and the bitmask to use.
 * @param object
 * @return an array containing the slot index and bit mask
 */
public UDATA[] getSlotIndexAndMask(J9ObjectPointer object) {
    UDATA heapBaseOffset = UDATA.cast(object).sub(UDATA.cast(_heapBase));
    if (heapBaseOffset.gte(_maxOffset)) {
        throw new IllegalArgumentException("Object is not in heap: " + object);
    }
    UDATA bitIndex = heapBaseOffset.bitAnd(_heapMapBitMask);
    bitIndex = bitIndex.rightShift(_heapMapBitShift);
    UDATA bitMask = new UDATA(1).leftShift(bitIndex);
    UDATA slotIndex = heapBaseOffset.rightShift(new UDATA(_heapMapIndexShift));
    UDATA[] result = new UDATA[2];
    result[0] = slotIndex;
    result[1] = bitMask;
    return result;
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Example 47 with J9ObjectPointer

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

the class GCUnfinalizedObjectListIterator method next.

public J9ObjectPointer next() {
    if (hasNext()) {
        J9ObjectPointer tmp = next;
        next = null;
        return tmp;
    } 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 48 with J9ObjectPointer

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

the class GCOwnableSynchronizerObjectListIterator method next.

public J9ObjectPointer next() {
    if (hasNext()) {
        J9ObjectPointer tmp = next;
        next = null;
        return tmp;
    } 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 49 with J9ObjectPointer

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

the class GCObjectHeapIteratorMarkMapIterator_V1 method next.

@Override
public J9ObjectPointer next() {
    if (hasNext()) {
        J9ObjectPointer next;
        if (null == _nextObject) {
            nextImpl();
        }
        next = _nextObject;
        _nextObject = null;
        if (null != next) {
            return next;
        }
    }
    throw new NoSuchElementException("No more objects");
}
Also used : J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer) NoSuchElementException(java.util.NoSuchElementException)

Example 50 with J9ObjectPointer

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

the class GCObjectHeapIteratorMarkMapIterator_V1 method peek.

@Override
public J9ObjectPointer peek() {
    if (hasNext()) {
        J9ObjectPointer next;
        if (null == _nextObject) {
            nextImpl();
        }
        next = _nextObject;
        if (null != next) {
            return next;
        }
    }
    throw new NoSuchElementException("No more objects");
}
Also used : 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