Search in sources :

Example 36 with VoidPointer

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

the class HashTable_V1 method hashTableFindNodeInTree.

private VoidPointer hashTableFindNodeInTree(J9HashTablePointer table, StructType entry, PointerPointer head) throws CorruptDataException {
    J9AVLTreePointer tree = avlTreeUntag(head.at(0));
    AVLTree avlTree = AVLTree.fromJ9AVLTreePointer(tree, _avlTreeComparatorFunction);
    J9AVLTreeNodePointer searchResult = avlTree.search(UDATA.cast(entry));
    if (searchResult.notNull()) {
        return avlNodeToData(searchResult);
    } else {
        return VoidPointer.NULL;
    }
}
Also used : J9AVLTreePointer(com.ibm.j9ddr.vm29.pointer.generated.J9AVLTreePointer) J9AVLTreeNodePointer(com.ibm.j9ddr.vm29.pointer.generated.J9AVLTreeNodePointer)

Example 37 with VoidPointer

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

the class HashTable_V1 method hashTableFindNodeInList.

private VoidPointer hashTableFindNodeInList(J9HashTablePointer table, StructType entry, PointerPointer head) throws CorruptDataException {
    /* Look through the list looking for the correct key */
    VoidPointer node = head.at(0);
    StructType currentStruct = (StructType) DataType.getStructure(_structType, node.getAddress());
    while ((!node.isNull()) && (!_equalFunctionWrapper.equal(currentStruct, entry))) {
        node = nextEA(node).at(0);
        currentStruct = (StructType) DataType.getStructure(_structType, node.getAddress());
    }
    return VoidPointer.cast(currentStruct);
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer)

Example 38 with VoidPointer

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

the class SimpleRootScanner method doMonitorReference.

@Override
protected void doMonitorReference(J9ObjectMonitorPointer slot, VoidPointer address) {
    try {
        J9ThreadAbstractMonitorPointer monitor = J9ThreadAbstractMonitorPointer.cast(slot.monitor());
        doSlot(J9ObjectPointer.cast(monitor.userData()), VoidPointer.cast(monitor.userDataEA()));
    } catch (CorruptDataException e) {
        EventManager.raiseCorruptDataEvent("Errror accessing object slot from J9ObjectMonitorPointer: " + slot.getHexAddress(), e, false);
    }
}
Also used : CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ThreadAbstractMonitorPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ThreadAbstractMonitorPointer)

Example 39 with VoidPointer

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

the class Pool_29_V0 method pool_nextDo.

// re-uses the existing state
private VoidPointer pool_nextDo() throws CorruptDataException {
    slot = 1 + state.lastSlot;
    UDATAPointer currAddr = null;
    if (state.leftToDo == 0) {
        if ((state.currentPuddle != null) && (state.currentPuddle.notNull())) {
            return poolPuddle_startDo(state.currentPuddle, true);
        } else {
            return null;
        }
    }
    while (isPuddleSlotFree(state.currentPuddle)) {
        slot++;
    }
    currAddr = UDATAPointer.cast(state.currentPuddle.firstElementAddress().getAddress() + (elementSize * slot));
    state.lastSlot = slot;
    state.leftToDo--;
    if (state.leftToDo == 0) {
        if ((state.flags & POOLSTATE_FOLLOW_NEXT_POINTERS) == POOLSTATE_FOLLOW_NEXT_POINTERS) {
            state.currentPuddle = state.currentPuddle.nextPuddle();
            state.lastSlot = -1;
        } else {
            state.currentPuddle = null;
        }
    }
    logger.fine(String.format("Next pool item 0x%016x", currAddr.getAddress()));
    if (logger.isLoggable(Level.FINER)) {
        logger.finer(state.toString());
    }
    return VoidPointer.cast(currAddr);
}
Also used : UDATAPointer(com.ibm.j9ddr.vm29.pointer.UDATAPointer)

Example 40 with VoidPointer

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

the class StringTable method cacheIterator.

public SlotIterator<J9ObjectPointer> cacheIterator() {
    return new SlotIterator<J9ObjectPointer>() {

        private UDATA cacheTableIndex;

        private UDATA cacheSize;

        private PointerPointer cache;

        {
            // Instance initialiser
            cacheTableIndex = new UDATA(0);
            try {
                cacheSize = getCacheSize();
                cache = _stringTable._cacheEA();
            } catch (CorruptDataException e) {
                raiseCorruptDataEvent("Error getting next item", e, false);
                cacheSize = new UDATA(0);
            }
        }

        public boolean hasNext() {
            while (cacheTableIndex.lt(cacheSize)) {
                try {
                    if (cache.at(cacheTableIndex).notNull()) {
                        return true;
                    }
                } catch (CorruptDataException e) {
                    raiseCorruptDataEvent("Error getting next item", e, false);
                }
                cacheTableIndex = cacheTableIndex.add(1);
            }
            return false;
        }

        public J9ObjectPointer next() {
            if (hasNext()) {
                try {
                    J9ObjectPointer cachedString = J9ObjectPointer.cast(cache.at(cacheTableIndex));
                    cacheTableIndex = cacheTableIndex.add(1);
                    return cachedString;
                } catch (CorruptDataException e) {
                    raiseCorruptDataEvent("Error getting next item", e, false);
                    return null;
                }
            } else {
                throw new NoSuchElementException("There are no more items available through this iterator");
            }
        }

        public VoidPointer nextAddress() {
            if (hasNext()) {
                VoidPointer address = VoidPointer.cast(cache.add(cacheTableIndex));
                cacheTableIndex = cacheTableIndex.add(1);
                return address;
            } else {
                throw new NoSuchElementException("There are no more items available through this iterator");
            }
        }

        public void remove() {
            throw new UnsupportedOperationException("The image is read only and cannot be modified.");
        }
    };
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer) NoSuchElementException(java.util.NoSuchElementException)

Aggregations

VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)48 CorruptDataException (com.ibm.j9ddr.CorruptDataException)37 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)15 NoSuchElementException (java.util.NoSuchElementException)13 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)9 UDATA (com.ibm.j9ddr.vm29.types.UDATA)9 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)5 GCVMThreadListIterator (com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator)5 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)5 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)4 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)3 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)3 CorruptData (com.ibm.dtfj.image.CorruptData)2 JavaObject (com.ibm.dtfj.java.JavaObject)2 J9DDRCorruptData (com.ibm.j9ddr.view.dtfj.image.J9DDRCorruptData)2 MonitorTable (com.ibm.j9ddr.vm29.j9.MonitorTable)2 GCJNIGlobalReferenceIterator (com.ibm.j9ddr.vm29.j9.gc.GCJNIGlobalReferenceIterator)2 GCJNIWeakGlobalReferenceIterator (com.ibm.j9ddr.vm29.j9.gc.GCJNIWeakGlobalReferenceIterator)2 GCObjectIterator (com.ibm.j9ddr.vm29.j9.gc.GCObjectIterator)2 BaseStackWalkerCallbacks (com.ibm.j9ddr.vm29.j9.stackwalker.BaseStackWalkerCallbacks)2