--- a/hotspot/src/share/vm/oops/markOop.cpp Tue Jul 14 11:40:49 2015 +0200
+++ b/hotspot/src/share/vm/oops/markOop.cpp Tue Jul 14 09:33:20 2015 -0700
@@ -32,26 +32,32 @@
void markOopDesc::print_on(outputStream* st) const {
if (is_marked()) {
st->print(" marked(" INTPTR_FORMAT ")", value());
+ } else if (has_monitor()) {
+ // have to check has_monitor() before is_locked()
+ st->print(" monitor(" INTPTR_FORMAT ")=", value());
+ ObjectMonitor* mon = monitor();
+ if (mon == NULL) {
+ st->print("NULL (this should never be seen!)");
+ } else {
+ st->print("{count=" INTPTR_FORMAT ",waiters=" INTPTR_FORMAT
+ ",recursions=" INTPTR_FORMAT ",owner=" INTPTR_FORMAT "}",
+ mon->count(), mon->waiters(), mon->recursions(),
+ p2i(mon->owner()));
+ }
} else if (is_locked()) {
st->print(" locked(" INTPTR_FORMAT ")->", value());
if (is_neutral()) {
st->print("is_neutral");
- if (has_no_hash()) st->print(" no_hash");
- else st->print(" hash=" INTPTR_FORMAT, hash());
+ if (has_no_hash()) {
+ st->print(" no_hash");
+ } else {
+ st->print(" hash=" INTPTR_FORMAT, hash());
+ }
st->print(" age=%d", age());
} else if (has_bias_pattern()) {
st->print("is_biased");
JavaThread* jt = biased_locker();
st->print(" biased_locker=" INTPTR_FORMAT, p2i(jt));
- } else if (has_monitor()) {
- ObjectMonitor* mon = monitor();
- if (mon == NULL)
- st->print("monitor=NULL");
- else {
- BasicLock * bl = (BasicLock *) mon->owner();
- st->print("monitor={count=" INTPTR_FORMAT ",waiters=" INTPTR_FORMAT ",recursions=" INTPTR_FORMAT ",owner=" INTPTR_FORMAT "}",
- mon->count(), mon->waiters(), mon->recursions(), p2i(bl));
- }
} else {
st->print("??");
}