use of com.ibm.j9ddr.vm29.pointer.U8Pointer in project openj9 by eclipse.
the class DTFJJavaRuntime method getServiceLevel.
private String getServiceLevel() {
try {
U8Pointer serviceLevelPointer = DataType.getJ9RASPointer().serviceLevel();
String serviceLevel = serviceLevelPointer.getCStringAtOffset(0);
if (serviceLevel != null && serviceLevel.length() > 0) {
return serviceLevel;
}
} catch (Throwable t) {
// If we can't access the memory then we'll have to go with "unknown".
J9DDRDTFJUtils.handleAsCorruptDataException(DTFJContext.getProcess(), t);
}
return "unknown";
}
use of com.ibm.j9ddr.vm29.pointer.U8Pointer in project openj9 by eclipse.
the class GCCardTable method cleanCardsInRegion.
public void cleanCardsInRegion(GCHeapRegionDescriptor region, GCCardCleaner cardCleaner) throws CorruptDataException {
U8Pointer lowCard = heapAddrToCardAddr(region.getLowAddress());
U8Pointer highCard = heapAddrToCardAddr(region.getHighAddress());
cleanRange(lowCard, highCard, cardCleaner);
}
use of com.ibm.j9ddr.vm29.pointer.U8Pointer in project openj9 by eclipse.
the class GCCardTable method cardAddrToHeapAddr.
public VoidPointer cardAddrToHeapAddr(U8Pointer cardAddr) {
/* Check passed card address is within the card table */
// Assert_MM_true((void *)cardAddr >= getCardTableStart());
// Assert_MM_true((void *)cardAddr < _cardTableMemory->getHeapTop());
UDATA index = UDATA.cast(cardAddr).sub(UDATA.cast(_cardTableStart));
UDATA delta = index.leftShift(CARD_SIZE_SHIFT);
return _heapBase.addOffset(delta);
}
use of com.ibm.j9ddr.vm29.pointer.U8Pointer in project openj9 by eclipse.
the class GCMemoryPool method freeEntryCheckGeneric.
/**
* Check individual entries. This check is the same for ALL collectors
* @param freeListEntry A structure to a free entry for all collectors (except Balanced)
* @throws CorruptFreeEntryException This needs to be caught by a listener to be of any use
* @return None. This function throws exceptions which are caught by the listener in checkFreeLists()
*/
protected void freeEntryCheckGeneric(GCHeapLinkedFreeHeader freeListEntry) throws CorruptDataException, CorruptFreeEntryException {
MM_HeapLinkedFreeHeaderPointer freeListEntryAddress = freeListEntry.getHeader();
UDATA size = freeListEntry.getSize();
GCHeapRegionDescriptor region = getRegion();
U8Pointer entryEndingAddressInclusive = U8Pointer.cast(freeListEntry.getHeader()).add(size.sub(1));
if (freeListEntry.getHeader().isNull()) {
throw new CorruptFreeEntryException("freeEntryCorrupt", freeListEntryAddress);
}
/* Make sure its a multi-slot dead object */
if (!(ObjectModel.isDeadObject(freeListEntry.getObject()) && !ObjectModel.isSingleSlotDeadObject(freeListEntry.getObject()))) {
throw new CorruptFreeEntryException("freeEntryCorrupt", freeListEntryAddress);
}
/* Self checks */
if (!region.isAddressInRegion(VoidPointer.cast(freeListEntryAddress))) {
throw new CorruptFreeEntryException("freeEntryCorrupt", freeListEntryAddress);
}
if (!region.isAddressInRegion(VoidPointer.cast(entryEndingAddressInclusive))) {
throw new CorruptFreeEntryException("sizeFieldInvalid", freeListEntryAddress);
}
}
use of com.ibm.j9ddr.vm29.pointer.U8Pointer in project openj9 by eclipse.
the class J9JavaVMHelper method getMethodFromPC.
/*
* Returns a program space pointer to the matching J9Method for the
* specified PC.
*/
public static J9MethodPointer getMethodFromPC(J9JavaVMPointer vmPtr, U8Pointer pc) throws CorruptDataException {
GCClassLoaderIterator it = GCClassLoaderIterator.from();
while (it.hasNext()) {
J9ClassLoaderPointer loader = it.next();
Iterator<J9ClassPointer> classIt = ClassIterator.fromJ9Classloader(loader);
while (classIt.hasNext()) {
J9ClassPointer clazz = classIt.next();
J9MethodPointer result = J9ClassHelper.getMethodFromPCAndClass(clazz, pc);
if (!result.isNull()) {
return result;
}
}
}
return J9MethodPointer.NULL;
}
Aggregations