use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.
the class GCPointerArrayIterator_V1 method nextAddress.
public VoidPointer nextAddress() {
try {
if (hasNext()) {
if (includeClassSlot) {
includeClassSlot = false;
return VoidPointer.cast(J9ObjectHelper.clazz(object).classObjectEA());
}
VoidPointer next = VoidPointer.cast(data.add(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;
}
}
use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.
the class GCPointerArrayletIterator_V1 method nextAddress.
public VoidPointer nextAddress() {
VoidPointer next = null;
try {
if (hasNext()) {
if (includeClassSlot) {
includeClassSlot = false;
next = VoidPointer.cast(J9ObjectHelper.clazz(object).classObjectEA());
} else {
next = indexableObjectModel.getElementAddress(J9IndexableObjectPointer.cast(object), scanIndex, (int) ObjectReferencePointer.SIZEOF);
scanIndex++;
}
} 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 next;
}
use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.
the class GCPointerArrayletIterator_V1 method next.
@Override
public J9ObjectPointer next() {
J9ObjectPointer next = null;
try {
if (hasNext()) {
if (includeClassSlot) {
includeClassSlot = false;
next = J9ObjectHelper.clazz(object).classObject();
} else {
VoidPointer elementAddress = indexableObjectModel.getElementAddress(J9IndexableObjectPointer.cast(object), scanIndex, (int) ObjectReferencePointer.SIZEOF);
next = ObjectReferencePointer.cast(elementAddress).at(0);
scanIndex++;
}
} 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 next;
}
use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.
the class GCObjectHeapIteratorAddressOrderedList_V1 method advanceScanPointer.
protected void advanceScanPointer() {
try {
while (scanPtr.lt(scanPtrTop)) {
// If there is a current object, advance past it
if (null != currentObject) {
if (ObjectModel.isDeadObject(currentObject)) {
UDATA deadObjectSize = ObjectModel.getSizeInBytesDeadObject(currentObject);
if (deadObjectSize.eq(0)) {
/* The size of a hole should not be 0 */
throw new CorruptDataException("Dead object at " + currentObject.getHexAddress() + " has an invalid size of 0");
}
scanPtr = scanPtr.add(deadObjectSize);
} else {
scanPtr = scanPtr.add(ObjectModel.getConsumedSizeInBytesWithHeader(currentObject));
}
currentObject = null;
}
// so we need to skip check for ranges in this case
if (scanPtr.gte(scanPtrTop)) {
return;
}
// Move past any TLH regions.
while (scanPtr.gt(excludedRanges[currentExcludedRange][1])) {
currentExcludedRange++;
}
if (scanPtr.gte(excludedRanges[currentExcludedRange][0])) {
// We're in an unused TLH region.
// TODO : this should report as a hole
scanPtr = U8Pointer.cast(excludedRanges[currentExcludedRange][1]);
currentExcludedRange++;
continue;
}
// Make sure we haven't run past the end
if (scanPtr.gte(scanPtrTop)) {
return;
}
// Found a candidate entity.
currentObject = J9ObjectPointer.cast(scanPtr);
if (!(includeLiveObjects && includeDeadObjects)) {
// If we're filtering by type make sure this one is suitable.
boolean isDead = ObjectModel.isDeadObject(currentObject);
if (!includeLiveObjects && !isDead) {
continue;
}
if (!includeDeadObjects && isDead) {
continue;
}
}
return;
}
} catch (CorruptDataException e) {
// can try to recover from this
raiseCorruptDataEvent("Error getting next item", e, false);
currentObject = null;
// cause iteration to cease
scanPtr = scanPtrTop;
}
}
use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.
the class GCObjectHeapIteratorMarkMapIterator_V1 method nextImpl.
protected void nextImpl() {
_nextObject = null;
while ((null == _nextObject) && ((_nextSlotIndex != _topSlotIndex) || (!_markWordCache.eq(0)))) {
while ((null == _nextObject) && (!_markWordCache.eq(0))) {
if (_markWordCache.allBitsIn(1)) {
// this is an object
_nextObject = convertToObject(_nextSlotIndex - 1, _shiftCount);
}
_shiftCount += 1;
_markWordCache = _markWordCache.rightShift(1);
}
if (null == _nextObject) {
try {
recacheMarkMapWord();
} catch (CorruptDataException e) {
raiseCorruptDataEvent("Error getting next item", e, false);
throw new NoSuchElementException("Failed to continue reading objects from region");
}
}
}
}
Aggregations