< prev index next >

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

Print this page

 65       if (klass != null) {
 66         klassName = klass.getName().asString();
 67       } else {
 68         klassName = "<unknown class>";
 69       }
 70       tty.print("(a ");
 71       if (klassName.equals("java/lang/Class")) {
 72         Oop obj = VM.getVM().getObjectHeap().newOop(hobj);
 73         klassName = java_lang_Class.asExternalName(obj);
 74         tty.print("java.lang.Class for ");
 75       }
 76       tty.println(klassName.replace('/', '.') + ")");
 77     }
 78   }
 79 
 80   private String identifyLockState(MonitorInfo monitor, String waitingState) {
 81     Mark mark = new Mark(monitor.owner());
 82     if (mark.hasMonitor() &&
 83         ( // we have marked ourself as pending on this monitor
 84           mark.monitor().equals(thread.getCurrentPendingMonitor()) ||

 85           // we are not the owner of this monitor
 86           !mark.monitor().isEntered(thread)
 87         )) {
 88       return waitingState;
 89     }
 90     return "locked";
 91   }
 92 
 93   /** Printing used during stack dumps */
 94   public void printLockInfo(PrintStream tty, int frameCount) {
 95     // If this is the first frame and it is java.lang.Object.wait(...)
 96     // then print out the receiver. Locals are not always available,
 97     // e.g., compiled native frames have no scope so there are no locals.
 98     if (frameCount == 0) {
 99       if (getMethod().getName().asString().equals("wait") &&
100           getMethod().getMethodHolder().getName().asString().equals("java/lang/Object")) {
101         String waitState = "waiting on"; // assume we are waiting
102         // If earlier in the output we reported java.lang.Thread.State ==
103         // "WAITING (on object monitor)" and now we report "waiting on", then
104         // we are still waiting for notification or timeout. Otherwise if

 65       if (klass != null) {
 66         klassName = klass.getName().asString();
 67       } else {
 68         klassName = "<unknown class>";
 69       }
 70       tty.print("(a ");
 71       if (klassName.equals("java/lang/Class")) {
 72         Oop obj = VM.getVM().getObjectHeap().newOop(hobj);
 73         klassName = java_lang_Class.asExternalName(obj);
 74         tty.print("java.lang.Class for ");
 75       }
 76       tty.println(klassName.replace('/', '.') + ")");
 77     }
 78   }
 79 
 80   private String identifyLockState(MonitorInfo monitor, String waitingState) {
 81     Mark mark = new Mark(monitor.owner());
 82     if (mark.hasMonitor() &&
 83         ( // we have marked ourself as pending on this monitor
 84           mark.monitor().equals(thread.getCurrentPendingMonitor()) ||
 85           mark.monitor().isOwnedAnonymous() ||
 86           // we are not the owner of this monitor
 87           !mark.monitor().isEntered(thread)
 88         )) {
 89       return waitingState;
 90     }
 91     return "locked";
 92   }
 93 
 94   /** Printing used during stack dumps */
 95   public void printLockInfo(PrintStream tty, int frameCount) {
 96     // If this is the first frame and it is java.lang.Object.wait(...)
 97     // then print out the receiver. Locals are not always available,
 98     // e.g., compiled native frames have no scope so there are no locals.
 99     if (frameCount == 0) {
100       if (getMethod().getName().asString().equals("wait") &&
101           getMethod().getMethodHolder().getName().asString().equals("java/lang/Object")) {
102         String waitState = "waiting on"; // assume we are waiting
103         // If earlier in the output we reported java.lang.Thread.State ==
104         // "WAITING (on object monitor)" and now we report "waiting on", then
105         // we are still waiting for notification or timeout. Otherwise if
< prev index next >