use of com.ibm.j9ddr.vm29.pointer.VoidPointer in project openj9 by eclipse.
the class GCArrayletObjectModelBase_V1 method getElementAddress.
@Override
public VoidPointer getElementAddress(J9IndexableObjectPointer array, int elementIndex, int elementSize) throws CorruptDataException {
boolean isInlineContiguous = isInlineContiguousArraylet(array);
UDATA byteOffsetIntoData = new UDATA(elementIndex * (long) elementSize);
if (isInlineContiguous) {
return VoidPointer.cast(getDataPointerForContiguous(array).addOffset(byteOffsetIntoData));
} else {
ObjectReferencePointer arrayoid = getArrayoidPointer(array);
UDATA arrayletIndex = byteOffsetIntoData.rightShift(arrayletLeafLogSize);
VoidPointer arrayletLeafBaseAddress = VoidPointer.cast(arrayoid.at(arrayletIndex));
if (arrayletLeafBaseAddress.isNull()) {
/* this can happen if the arraylet wasn't fully initialized */
throw new NoSuchElementException("Arraylet leaf not yet initialized");
}
UDATA indexIntoArraylet = byteOffsetIntoData.bitAnd(arrayletLeafSizeMask);
return arrayletLeafBaseAddress.addOffset(indexIntoArraylet);
}
}
use of com.ibm.j9ddr.vm29.pointer.VoidPointer in project openj9 by eclipse.
the class GCClassLocalInterfaceIterator method nextAddress.
public VoidPointer nextAddress() {
if (hasNext()) {
try {
VoidPointer next = VoidPointer.cast(iTable.interfaceClassEA());
iTable = iTable.next();
return next;
} catch (CorruptDataException e) {
// can try to recover from this
raiseCorruptDataEvent("Error getting next item", e, false);
return null;
}
} else {
throw new NoSuchElementException("There are no more items available through this iterator");
}
}
use of com.ibm.j9ddr.vm29.pointer.VoidPointer in project openj9 by eclipse.
the class GCCardTable method cleanRange.
public void cleanRange(U8Pointer lowCard, U8Pointer highCard, GCCardCleaner cardCleaner) throws CorruptDataException {
U8Pointer thisCard = lowCard;
U8Pointer endCard = highCard;
while (thisCard.lt(endCard)) {
try {
U8 card = thisCard.at(0);
if (!card.eq(J9ModroncoreConstants.CARD_CLEAN)) {
VoidPointer lowAddress = cardAddrToHeapAddr(thisCard);
VoidPointer highAddress = lowAddress.addOffset(J9ModroncoreConstants.CARD_SIZE);
cardCleaner.clean(lowAddress, highAddress, thisCard);
}
} catch (CorruptDataException cde) {
raiseCorruptDataEvent("Corrupt Card", cde, false);
}
thisCard = thisCard.add(1);
}
}
use of com.ibm.j9ddr.vm29.pointer.VoidPointer in project openj9 by eclipse.
the class GCMixedObjectIterator_V1 method nextAddress.
public VoidPointer nextAddress() {
try {
if (hasNext()) {
if (object != null && 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.vm29.pointer.VoidPointer in project openj9 by eclipse.
the class GCVMThreadMonitorRecordSlotIterator method nextAddress.
public VoidPointer nextAddress() {
if (hasNext()) {
try {
VoidPointer next;
if (monitorRecord.notNull()) {
next = VoidPointer.cast(monitorRecord.objectEA());
monitorRecord = monitorRecord.next();
} else {
next = VoidPointer.cast(jniMonitorRecord.objectEA());
jniMonitorRecord = jniMonitorRecord.next();
}
return next;
} catch (CorruptDataException e) {
// can try to recover from this
raiseCorruptDataEvent("Error getting next item", e, false);
return null;
}
} else {
throw new NoSuchElementException("There are no more items available through this iterator");
}
}
Aggregations