Search in sources :

Example 21 with UDATA

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);
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Example 22 with UDATA

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;
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 23 with UDATA

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);
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) U32(com.ibm.j9ddr.vm29.types.U32) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 24 with UDATA

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;
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 25 with UDATA

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));
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Aggregations

UDATA (com.ibm.j9ddr.vm29.types.UDATA)86 CorruptDataException (com.ibm.j9ddr.CorruptDataException)22 U32 (com.ibm.j9ddr.vm29.types.U32)16 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)14 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)10 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)10 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)9 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)8 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)8 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)7 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)6 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)5 J9ROMMethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer)4 U16 (com.ibm.j9ddr.vm29.types.U16)4 J9ObjectFieldOffset (com.ibm.j9ddr.vm29.j9.J9ObjectFieldOffset)3 GCHeapRegionDescriptor (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor)3 J9ArrayClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ArrayClassPointer)3 J9JITExceptionTablePointer (com.ibm.j9ddr.vm29.pointer.generated.J9JITExceptionTablePointer)3 J9MethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)3 IDATA (com.ibm.j9ddr.vm29.types.IDATA)3