use of com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer in project openj9 by eclipse.
the class GCVMThreadStackSlotIterator method scanSlots.
static void scanSlots(J9VMThreadPointer walkThread, IStackWalkerCallbacks stackWalkerCallbacks, boolean includeStackFrameClassReferences, boolean trackVisibleFrameDepth) {
WalkState walkState = new WalkState();
walkState.flags = J9_STACKWALK_ITERATE_O_SLOTS | J9_STACKWALK_DO_NOT_SNIFF_AND_WHACK;
walkState.walkThread = walkThread;
walkState.callBacks = stackWalkerCallbacks;
if (trackVisibleFrameDepth) {
walkState.skipCount = 0;
walkState.flags |= J9_STACKWALK_VISIBLE_ONLY;
} else {
walkState.flags |= J9_STACKWALK_SKIP_INLINES;
}
if (includeStackFrameClassReferences) {
walkState.flags |= J9_STACKWALK_ITERATE_METHOD_CLASS_SLOTS;
}
StackWalkResult result = StackWalkResult.STACK_CORRUPT;
result = StackWalker.walkStackFrames(walkState);
if (StackWalkResult.NONE != result) {
/* Explicitly raising a corrupt data event here since returning StackWalkResult.STACK_CORRUPT is fairly common if a core is not taken at a safe gc point */
CorruptDataException corruptDataException = new CorruptDataException("Stack walk returned: " + result + " for vmThread: " + walkThread.getHexAddress());
EventManager.raiseCorruptDataEvent("", corruptDataException, false);
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer in project openj9 by eclipse.
the class ObjectMonitor_V1 method initializeWaitingThreads.
private void initializeWaitingThreads() throws CorruptDataException {
waitingThreads = new ArrayList<J9VMThreadPointer>();
if (!isInflated) {
return;
}
J9ThreadPointer thread = monitor.waiting();
while (thread.notNull()) {
J9VMThreadPointer vmThread = J9ThreadHelper.getVMThread(thread);
if (vmThread.notNull()) {
waitingThreads.add(vmThread);
}
thread = thread.next();
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer in project openj9 by eclipse.
the class StackRoots method walkStacks.
private void walkStacks() throws CorruptDataException {
GCVMThreadListIterator threadIterator = GCVMThreadListIterator.from();
while (threadIterator.hasNext()) {
J9VMThreadPointer next = threadIterator.next();
WalkState walkState = new WalkState();
walkState.walkThread = next;
walkState.flags = J9_STACKWALK_SKIP_INLINES | J9_STACKWALK_ITERATE_O_SLOTS | J9_STACKWALK_ITERATE_METHOD_CLASS_SLOTS;
walkState.callBacks = new StackWalkerCallbacks();
StackWalkResult result = StackWalkResult.STACK_CORRUPT;
result = StackWalker.walkStackFrames(walkState);
if (StackWalkResult.NONE != result) {
throw new UnsupportedOperationException("Failed to walk stack");
}
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer 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");
}
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer in project openj9 by eclipse.
the class ObjectMonitor_V1 method initializeBlockedThreads.
private void initializeBlockedThreads() throws CorruptDataException {
blockedThreads = new ArrayList<J9VMThreadPointer>();
if (isInflated) {
if (OmrBuildFlags.OMR_THR_THREE_TIER_LOCKING) {
J9ThreadPointer thread = monitor.blocking();
while (thread.notNull()) {
J9VMThreadPointer vmThread = J9ThreadHelper.getVMThread(thread);
if (vmThread.notNull()) {
blockedThreads.add(vmThread);
}
thread = thread.next();
}
} else {
List<J9VMThreadPointer> list = getBlockedThreads(object);
if (list != null) {
blockedThreads.addAll(list);
}
}
} else {
// For consistency we walk the thread list and check for blocking objects
// rather than do lockword.allBitsIn(OBJECT_HEADER_LOCK_FLC); as the lockword
// is set slightly later (the thread may spin first). See: CMVC 201473
List<J9VMThreadPointer> list = getBlockedThreads(object);
if (list != null) {
blockedThreads.addAll(list);
}
}
}
Aggregations