use of com.ibm.j9ddr.vm29.pointer.VoidPointer 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.vm29.pointer.VoidPointer 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.vm29.pointer.VoidPointer 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.vm29.pointer.VoidPointer in project openj9 by eclipse.
the class StackWalkerUtils method WALK_NAMED_INDIRECT_O_SLOT.
public static void WALK_NAMED_INDIRECT_O_SLOT(WalkState walkState, PointerPointer objectSlot, VoidPointer indirectSlot, String tag) throws CorruptDataException {
UDATA value;
value = UDATAPointer.cast(objectSlot).at(0);
if (indirectSlot.notNull()) {
swPrintf(walkState, 4, "\t\t{0}[{1} -> {2}] = {3}", (tag != null ? tag : "O-Slot"), indirectSlot.getHexAddress(), objectSlot.getHexAddress(), value.getHexValue());
} else {
swPrintf(walkState, 4, "\t\t{0}[{1}] = {2}", (tag != null ? tag : "O-Slot"), objectSlot.getHexAddress(), value.getHexValue());
}
walkState.callBacks.objectSlotWalkFunction(walkState.walkThread, walkState, objectSlot, VoidPointer.cast(objectSlot));
}
use of com.ibm.j9ddr.vm29.pointer.VoidPointer in project openj9 by eclipse.
the class J9MemTagIterator method internalNext.
private J9MemTagPointer internalNext() {
long result;
this.isFooterCorrupted = false;
/* Hunt for the header eyecatcher */
do {
result = DataType.getProcess().findPattern(headerEyecatcherBytes, UDATA.SIZEOF, currentSearchAddress);
if (result == -1) {
return null;
}
if (Addresses.greaterThan(result, topAddress)) {
return null;
}
/* Move the current search address beyond the current result */
currentSearchAddress = result + UDATA.SIZEOF;
/* Address is in range - does it point to a valid block? */
VoidPointer memoryBase = j9mem_get_memory_base(J9MemTagPointer.cast(result));
try {
IDATA corruption = j9mem_check_tags(VoidPointer.cast(memoryBase), headerEyecatcher, footerEyecatcher);
if (corruption.allBitsIn(J9PORT_MEMTAG_NOT_A_TAG.longValue())) {
/* This is not a memory tag */
continue;
}
if (corruption.allBitsIn(J9PORT_MEMTAG_FOOTER_TAG_CORRUPTED.longValue()) || corruption.allBitsIn(J9PORT_MEMTAG_FOOTER_PADDING_CORRUPTED.longValue())) {
/*
* A block with corrupted footer is accepted only and only if
* we are dealing with freed memory. Therefore, following check is double check.
* If we are here, then it is freed memory is being looked for with the current algorithm.
*
*/
if (headerEyecatcher == J9MEMTAG_EYECATCHER_FREED_HEADER && footerEyecatcher == J9MEMTAG_EYECATCHER_FREED_FOOTER) {
this.isFooterCorrupted = true;
return J9MemTagPointer.cast(result);
}
}
} catch (J9MemTagCheckError e) {
/* Tag is readable, but corrupt */
if (!lookingForFreedCallSites) {
EventManager.raiseCorruptDataEvent("Corrupt memory section found", e, false);
}
/* Find the next section */
continue;
}
return J9MemTagPointer.cast(result);
} while (true);
}
Aggregations