< prev index next >

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

Print this page

 60       tty.format("\t- %s <" + ADDRESS_FORMAT + "> ",
 61                  lockState, hobj.asLongValue());
 62 
 63       Klass klass = Oop.getKlassForOopHandle(hobj);
 64       String klassName = klass.getName().asString();
 65       tty.print("(a ");
 66       if (klassName.equals("java/lang/Class")) {
 67         Oop obj = VM.getVM().getObjectHeap().newOop(hobj);
 68         klassName = java_lang_Class.asExternalName(obj);
 69         tty.print("java.lang.Class for ");
 70       }
 71       tty.println(klassName.replace('/', '.') + ")");
 72     }
 73   }
 74 
 75   private String identifyLockState(MonitorInfo monitor, String waitingState) {
 76     Mark mark = new Mark(monitor.owner());
 77     if (mark.hasMonitor() &&
 78         ( // we have marked ourself as pending on this monitor
 79           mark.monitor().equals(thread.getCurrentPendingMonitor()) ||




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

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