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