Search in sources :

Example 1 with Pointer

use of com.ibm.j9ddr.vm29.pointer.Pointer in project openj9 by eclipse.

the class HashTable_V1 method find.

// find by pointer value
@Override
public StructType find(StructType entry) throws CorruptDataException {
    UDATA hash = _hashFn.hash(entry).mod(_table.tableSize());
    PointerPointer head = _table.nodes().add(hash);
    VoidPointer findNode = VoidPointer.NULL;
    if (_table.listNodePool().isNull()) {
        PointerPointer node = hashTableFindNodeSpaceOpt(_table, entry, head);
        if (node.at(0).notNull()) {
            findNode = VoidPointer.cast(node);
        } else {
            findNode = VoidPointer.NULL;
        }
    } else if (head.at(0).isNull()) {
        findNode = VoidPointer.NULL;
    } else if (isAVLTreeTagged(head.at(0))) {
        findNode = hashTableFindNodeInTree(_table, entry, head);
    } else {
        findNode = hashTableFindNodeInList(_table, entry, head);
    }
    if (!_isInline && findNode.notNull()) {
        findNode = PointerPointer.cast(findNode).at(0);
    }
    StructType node = (StructType) DataType.getStructure(_structType, findNode.getAddress());
    return node;
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer)

Example 2 with Pointer

use of com.ibm.j9ddr.vm29.pointer.Pointer in project openj9 by eclipse.

the class GCArrayletObjectModelBase_V1 method getDataSizeInBytes.

/**
 * Returns the size of data in an indexable object, in bytes, including leaves, excluding the header.
 * @param arrayPtr Pointer to the indexable object whose size is required
 * @return Size of object in bytes excluding the header
 */
public UDATA getDataSizeInBytes(J9IndexableObjectPointer array) throws CorruptDataException {
    J9ArrayClassPointer clazz = J9IndexableObjectHelper.clazz(array);
    U32 arrayShape = J9ROMArrayClassPointer.cast(clazz.romClass()).arrayShape();
    UDATA numberOfElements = getSizeInElements(array);
    UDATA size = numberOfElements.leftShift(arrayShape.bitAnd(0x0000FFFF).intValue());
    return UDATA.roundToSizeofUDATA(size);
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) U32(com.ibm.j9ddr.vm29.types.U32) J9ArrayClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ArrayClassPointer)

Example 3 with Pointer

use of com.ibm.j9ddr.vm29.pointer.Pointer in project openj9 by eclipse.

the class GCArrayletObjectModelBase_V1 method getArrayLayout.

/**
 * Get the layout for the given indexable object
 * @param objPtr Pointer to a array object
 * @return the ArrayLayout for objectPtr
 */
protected long getArrayLayout(J9IndexableObjectPointer array) throws CorruptDataException {
    if (J9BuildFlags.gc_hybridArraylets) {
        /* Trivial check for InlineContiguous. */
        if (!J9IndexableObjectContiguousPointer.cast(array).size().eq(0)) {
            return GC_ArrayletObjectModelBase$ArrayLayout.InlineContiguous;
        }
    }
    /* Check if the objPtr is in the allowed arraylet range. */
    if ((array.gte(arrayletRangeBase)) && (array.lt(arrayletRangeTop))) {
        UDATA dataSizeInBytes = getDataSizeInBytes(array);
        long layout = getArrayLayout(J9IndexableObjectHelper.clazz(array), dataSizeInBytes);
        return layout;
    }
    return GC_ArrayletObjectModelBase$ArrayLayout.InlineContiguous;
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Example 4 with Pointer

use of com.ibm.j9ddr.vm29.pointer.Pointer in project openj9 by eclipse.

the class GCArrayletObjectModelBase_V1 method getSpineSize.

/**
 * Get the spine size for the given indexable object
 * @param objPtr Pointer to an array object
 * @return The total size in bytes of objPtr's array spine;
 * 			includes header, arraylet ptrs, and (if present) padding & inline data
 */
protected UDATA getSpineSize(J9IndexableObjectPointer array) throws CorruptDataException {
    long layout = getArrayLayout(array);
    boolean alignData = shouldAlignSpineDataSection(J9IndexableObjectHelper.clazz(array));
    UDATA dataSize = getDataSizeInBytes(array);
    UDATA numberArraylets = numArraylets(dataSize);
    return getSpineSize(layout, numberArraylets, dataSize, alignData);
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Example 5 with Pointer

use of com.ibm.j9ddr.vm29.pointer.Pointer in project openj9 by eclipse.

the class GCArrayletObjectModelBase_V1 method numExternalArraylets.

/**
 * Return the total number of arraylets for an indexable object, not including the arraylet in the spine.
 * Note that discontiugous arrays always have an empty leaf contained in the spine.
 * @param array pointer to array
 * @return the number of leaf arraylets
 */
protected UDATA numExternalArraylets(J9IndexableObjectPointer array) throws CorruptDataException {
    UDATA numberOfArraylets = new UDATA(0);
    if ((getArrayLayout(array) != GC_ArrayletObjectModelBase$ArrayLayout.InlineContiguous)) {
        numberOfArraylets = numArraylets(getDataSizeInBytes(array));
        numberOfArraylets = numberOfArraylets.sub(1);
    }
    return numberOfArraylets;
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Aggregations

CorruptDataException (com.ibm.j9ddr.CorruptDataException)14 UDATA (com.ibm.j9ddr.vm29.types.UDATA)14 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)6 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)5 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)4 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)4 GCHeapRegionDescriptor (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor)3 AbstractPointer (com.ibm.j9ddr.vm29.pointer.AbstractPointer)3 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)3 ImageSection (com.ibm.dtfj.image.ImageSection)2 FieldDescriptor (com.ibm.j9ddr.StructureReader.FieldDescriptor)2 StructureDescriptor (com.ibm.j9ddr.StructureReader.StructureDescriptor)2 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)2 J9DDRImageSection (com.ibm.j9ddr.view.dtfj.image.J9DDRImageSection)2 GCClassLoaderIterator (com.ibm.j9ddr.vm29.j9.gc.GCClassLoaderIterator)2 GCHeapRegionIterator (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionIterator)2 GCScavengerForwardedHeader (com.ibm.j9ddr.vm29.j9.gc.GCScavengerForwardedHeader)2 GCVMThreadListIterator (com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator)2 U32Pointer (com.ibm.j9ddr.vm29.pointer.U32Pointer)2 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)2