Search in sources :

Example 6 with MM_HeapRegionDescriptorPointer

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

the class GCHeapSpanRegionIterator method next.

public MM_HeapRegionDescriptorPointer next() {
    if (_regionsLeft > 0) {
        MM_HeapRegionDescriptorPointer region = _currentRegion;
        _regionsLeft--;
        _currentRegion = _currentRegion.addOffset(_tableDescriptorSize);
        return region;
    } else {
        throw new NoSuchElementException("There are no more items available through this iterator");
    }
}
Also used : MM_HeapRegionDescriptorPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionDescriptorPointer) NoSuchElementException(java.util.NoSuchElementException)

Example 7 with MM_HeapRegionDescriptorPointer

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

the class GCHeapRegionIterator method getNextTableRegion.

protected MM_HeapRegionDescriptorPointer getNextTableRegion(MM_HeapRegionDescriptorPointer heapRegion) throws CorruptDataException {
    MM_HeapRegionDescriptorPointer next = heapRegion.addOffset(_tableDescriptorSize * heapRegion._regionsInSpan().longValue());
    if (next.isNull()) {
        return null;
    }
    MM_HeapRegionDescriptorPointer top = MM_HeapRegionDescriptorPointer.cast(_regionManager._regionTable().longValue() + (_tableDescriptorSize * _regionManager._tableRegionCount().longValue()));
    MM_HeapRegionDescriptorPointer usedRegion = MM_HeapRegionDescriptorPointer.NULL;
    MM_HeapRegionDescriptorPointer current = next;
    while (usedRegion.isNull() && current.lt(top)) {
        if (current._isAllocated()) {
            usedRegion = current;
        } else {
            current = current.addOffset(_tableDescriptorSize * current._regionsInSpan().longValue());
        }
    }
    if (usedRegion.isNull()) {
        return null;
    }
    return usedRegion;
}
Also used : MM_HeapRegionDescriptorPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionDescriptorPointer)

Example 8 with MM_HeapRegionDescriptorPointer

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

the class MM_HeapRegionDescriptorHelper method getWalkableHighAddress.

public static VoidPointer getWalkableHighAddress(MM_HeapRegionDescriptorPointer region) throws CorruptDataException {
    VoidPointer top = null;
    long regionType = region._regionType();
    if ((MM_HeapRegionDescriptor$RegionType.BUMP_ALLOCATED == regionType) || (MM_HeapRegionDescriptor$RegionType.BUMP_ALLOCATED_MARKED == regionType)) {
        top = MM_MemoryPoolBumpPointerPointer.cast(region._memoryPool())._allocatePointer();
    } else {
        top = getHighAddress(region);
    }
    return top;
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer)

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