use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.
the class GCObjectHeapIteratorSegregated_V1 method calculateActualScanPtrTop.
private void calculateActualScanPtrTop() {
if (MM_HeapRegionDescriptor$RegionType.SEGREGATED_SMALL == type) {
UDATA cellCount = UDATA.cast(scanPtrTop).sub(UDATA.cast(scanPtr)).div(cellSize);
UDATA actualSize = cellCount.mult(cellSize);
scanPtrTop = scanPtr.add(actualSize);
}
}
use of com.ibm.j9ddr.vm29.types.UDATA 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.vm29.types.UDATA in project openj9 by eclipse.
the class GCScavengerForwardedHeader_V1 method getForwardedObjectNoCheck.
protected J9ObjectPointer getForwardedObjectNoCheck() throws CorruptDataException {
if (J9BuildFlags.interp_compressedObjectHeader && !J9BuildFlags.env_littleEndian) {
/* compressed big endian - read two halves separately */
U32 low = U32Pointer.cast(objectPointer.clazzEA()).at(0).bitAnd(~ALL_TAGS);
U32 high = U32Pointer.cast(objectPointer.clazzEA()).at(1);
J9ObjectPointer forwardedObject = J9ObjectPointer.cast(new UDATA(low).bitOr(new UDATA(high).leftShift(32)));
return forwardedObject;
} else {
/* Little endian or not compressed - read all UDATA bytes at once */
J9ObjectPointer forwardedObject = J9ObjectPointer.cast(UDATAPointer.cast(objectPointer.clazzEA()).at(0));
return forwardedObject.untag(ALL_TAGS);
}
}
use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.
the class GCScavengerForwardedHeader_V1 method getObjectSize.
@Override
public UDATA getObjectSize() throws CorruptDataException {
J9ObjectPointer forwardedObject = getForwardedObjectNoCheck();
UDATA forwardedObjectSize;
if (ObjectModel.hasBeenMoved(forwardedObject) && !ObjectModel.hasBeenHashed(forwardedObject)) {
// this hashed but not moved yet object just has been forwarded
// so hash slot was added which increase size of the object
forwardedObjectSize = ObjectModel.getSizeInBytesWithHeader(forwardedObject);
forwardedObjectSize = ObjectModel.adjustSizeInBytes(forwardedObjectSize);
} else {
forwardedObjectSize = ObjectModel.getConsumedSizeInBytesWithHeader(forwardedObject);
}
return forwardedObjectSize;
}
use of com.ibm.j9ddr.vm29.types.UDATA 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));
}
Aggregations