Search in sources :

Example 1 with ObjectMonitorReferencePointer

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

the class RootScanner method scanMonitorLookupCaches.

protected void scanMonitorLookupCaches() throws CorruptDataException {
    setReachability(Reachability.WEAK);
    GCVMThreadListIterator vmThreadListIterator = GCVMThreadListIterator.from();
    while (vmThreadListIterator.hasNext()) {
        J9VMThreadPointer walkThread = vmThreadListIterator.next();
        if (J9BuildFlags.thr_lockNursery) {
            ObjectMonitorReferencePointer objectMonitorLookupCache = walkThread.objectMonitorLookupCacheEA();
            for (long cacheIndex = 0; cacheIndex < J9VMThread.J9VMTHREAD_OBJECT_MONITOR_CACHE_SIZE; cacheIndex++) {
                ObjectMonitorReferencePointer slotAddress = objectMonitorLookupCache.add(cacheIndex);
                doMonitorLookupCacheSlot(slotAddress.at(0), slotAddress);
            }
        } else {
            /* Can't implement this because walkThread.cachedMonitor field does not exist as we've never had a vm29 spec yet with the condition: 
				 * (!J9BuildFlags.thr_lockNursery && !J9BuildFlags.opt_realTimeLockingSupport)
				 * 
				 * // This cast is ugly but is technically what the c-code is doing 
				 * ObjectMonitorReferencePointer cachedMonitorSlot = ObjectMonitorReferencePointer.cast(walkThread.cachedMonitorEA());
				 * doMonitorLookupCacheSlot(walkThread.cachedMonitor(), cachedMonitorSlot);
				 */
            throw new UnsupportedOperationException("Not implemented");
        }
    }
}
Also used : ObjectMonitorReferencePointer(com.ibm.j9ddr.vm29.pointer.ObjectMonitorReferencePointer) GCVMThreadListIterator(com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator) J9VMThreadPointer(com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)

Example 2 with ObjectMonitorReferencePointer

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

the class SimpleRootScanner method doMonitorLookupCacheSlot.

@Override
protected void doMonitorLookupCacheSlot(J9ObjectMonitorPointer slot, ObjectMonitorReferencePointer 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)

Aggregations

CorruptDataException (com.ibm.j9ddr.CorruptDataException)1 GCVMThreadListIterator (com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator)1 ObjectMonitorReferencePointer (com.ibm.j9ddr.vm29.pointer.ObjectMonitorReferencePointer)1 J9ThreadAbstractMonitorPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ThreadAbstractMonitorPointer)1 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)1