< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThread.java

Print this page

377 
378     // FIXME: add in the rest of the routine from the VM
379 
380     // Traverse the execution stack
381     for(StackFrameStream fst = new StackFrameStream(this); !fst.isDone(); fst.next()) {
382       fst.getCurrent().oopsDo(oopVisitor, fst.getRegisterMap());
383     }
384   }
385 
386   public boolean isInStack(Address a) {
387     if (Assert.ASSERTS_ENABLED) {
388       Assert.that(VM.getVM().isDebugging(), "Not yet implemented for non-debugging system");
389     }
390     Address sp      = lastSPDbg();
391     Address stackBase = getStackBase();
392     // Be robust
393     if (sp == null) return false;
394     return stackBase.greaterThan(a) && sp.lessThanOrEqual(a);
395   }
396 
397   public boolean isLockOwned(Address a) {
398     Address stackBase = getStackBase();
399     Address stackLimit = stackBase.addOffsetTo(-getStackSize());
400 
401     return stackBase.greaterThan(a) && stackLimit.lessThanOrEqual(a);
402 
403     // FIXME: should traverse MonitorArray/MonitorChunks as in VM
404   }
405 
406   public Oop getCurrentParkBlocker() {
407     Oop threadObj = getThreadObj();
408     if (threadObj != null) {
409       try {
410         return OopUtilities.threadOopGetParkBlocker(threadObj);
411       } catch (Exception e) {
412         System.out.println("Could not get current park blocker: " + e);
413       }
414     }
415     return null;
416   }
417 
418   public JNIHandleBlock activeHandles() {
419     Address a = activeHandlesField.getAddress(addr);
420     if (a == null) {
421       return null;
422     }
423     return new JNIHandleBlock(a);
424   }
425 

377 
378     // FIXME: add in the rest of the routine from the VM
379 
380     // Traverse the execution stack
381     for(StackFrameStream fst = new StackFrameStream(this); !fst.isDone(); fst.next()) {
382       fst.getCurrent().oopsDo(oopVisitor, fst.getRegisterMap());
383     }
384   }
385 
386   public boolean isInStack(Address a) {
387     if (Assert.ASSERTS_ENABLED) {
388       Assert.that(VM.getVM().isDebugging(), "Not yet implemented for non-debugging system");
389     }
390     Address sp      = lastSPDbg();
391     Address stackBase = getStackBase();
392     // Be robust
393     if (sp == null) return false;
394     return stackBase.greaterThan(a) && sp.lessThanOrEqual(a);
395   }
396 









397   public Oop getCurrentParkBlocker() {
398     Oop threadObj = getThreadObj();
399     if (threadObj != null) {
400       try {
401         return OopUtilities.threadOopGetParkBlocker(threadObj);
402       } catch (Exception e) {
403         System.out.println("Could not get current park blocker: " + e);
404       }
405     }
406     return null;
407   }
408 
409   public JNIHandleBlock activeHandles() {
410     Address a = activeHandlesField.getAddress(addr);
411     if (a == null) {
412       return null;
413     }
414     return new JNIHandleBlock(a);
415   }
416 
< prev index next >