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);
}
}
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;
}
}
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;
}
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;
}
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;
}
Aggregations