Search in sources :

Example 1 with MM_HeapRegionDescriptorPointer

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

the class GCHeapRegionDescriptor_V1 method init.

protected void init() throws CorruptDataException {
    lowAddress = heapRegionDescriptor._lowAddress();
    regionsInSpan = heapRegionDescriptor._regionsInSpan();
    regionType = heapRegionDescriptor._regionType();
    MM_MemorySubSpacePointer subSpace = heapRegionDescriptor._memorySubSpace();
    if (subSpace.notNull()) {
        typeFlags = subSpace._memoryType().bitOr(J9MemorySegment.MEMORY_TYPE_RAM);
    } else {
        typeFlags = new UDATA(0);
    }
    memorySubSpace = heapRegionDescriptor._memorySubSpace();
    memoryPool = heapRegionDescriptor._memoryPool();
    if (regionsInSpan.eq(0)) {
        highAddress = heapRegionDescriptor._highAddress();
    } else {
        UDATA delta = UDATA.cast(heapRegionDescriptor._highAddress()).sub(UDATA.cast(lowAddress));
        highAddress = lowAddress.addOffset(regionsInSpan.mult(delta));
    }
    MM_HeapRegionDescriptorPointer head = heapRegionDescriptor._headOfSpan();
    if (head.isNull() || head.eq(heapRegionDescriptor)) {
        headOfSpan = this;
    } else {
        headOfSpan = GCHeapRegionDescriptor.fromHeapRegionDescriptor(head);
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) MM_HeapRegionDescriptorPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionDescriptorPointer) MM_MemorySubSpacePointer(com.ibm.j9ddr.vm29.pointer.generated.MM_MemorySubSpacePointer)

Example 2 with MM_HeapRegionDescriptorPointer

use of com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionDescriptorPointer 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 3 with MM_HeapRegionDescriptorPointer

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

the class GCHeapRegionManager method initializeTableRegionDescriptors.

protected void initializeTableRegionDescriptors() throws CorruptDataException {
    GCHeapRegionDescriptor[] table = new GCHeapRegionDescriptor[_tableRegionCount];
    if (table.length > 0) {
        MM_HeapRegionDescriptorPointer current = _heapRegionManager._regionTable();
        for (int i = 0; i < _tableRegionCount; i++) {
            table[i] = GCHeapRegionDescriptor.fromHeapRegionDescriptor(current);
            current = current.addOffset(_tableDescriptorSize);
        }
    }
    _regionTable = table;
}
Also used : MM_HeapRegionDescriptorPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionDescriptorPointer)

Example 4 with MM_HeapRegionDescriptorPointer

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

the class MM_HeapRegionDescriptorHelper method getHighAddress.

public static VoidPointer getHighAddress(MM_HeapRegionDescriptorPointer region) throws CorruptDataException {
    VoidPointer result = VoidPointer.NULL;
    long regionsInSpan = region._regionsInSpan().longValue();
    if (regionsInSpan == 0) {
        result = region._highAddress();
    } else {
        UDATA low = UDATA.cast(region._lowAddress());
        UDATA high = UDATA.cast(region._highAddress());
        UDATA delta = high.sub(low);
        UDATA spanningSize = delta.mult((int) regionsInSpan);
        result = VoidPointer.cast(low.add(spanningSize));
    }
    return result;
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer)

Example 5 with MM_HeapRegionDescriptorPointer

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

the class GCHeapRegionManager method initializeAuxRegionDescriptors.

protected void initializeAuxRegionDescriptors() throws CorruptDataException {
    GCHeapRegionDescriptor[] auxRegions = new GCHeapRegionDescriptor[_auxRegionCount];
    if (auxRegions.length > 0) {
        MM_HeapRegionDescriptorPointer current = _heapRegionManager._auxRegionDescriptorList();
        for (int i = 0; i < _auxRegionCount; i++) {
            auxRegions[i] = GCHeapRegionDescriptor.fromHeapRegionDescriptor(current);
            current = current._nextRegion();
        }
    }
    _auxRegionDescriptorList = auxRegions;
}
Also used : MM_HeapRegionDescriptorPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionDescriptorPointer)

Aggregations

MM_HeapRegionDescriptorPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionDescriptorPointer)6 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)2 UDATA (com.ibm.j9ddr.vm29.types.UDATA)2 CorruptDataException (com.ibm.j9ddr.CorruptDataException)1 MM_MemorySubSpacePointer (com.ibm.j9ddr.vm29.pointer.generated.MM_MemorySubSpacePointer)1 NoSuchElementException (java.util.NoSuchElementException)1