1.1 --- a/src/share/vm/oops/markOop.cpp Wed Feb 11 18:56:26 2015 -0800 1.2 +++ b/src/share/vm/oops/markOop.cpp Fri Feb 20 22:12:53 2015 -0500 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -25,17 +25,40 @@ 1.11 #include "precompiled.hpp" 1.12 #include "oops/markOop.hpp" 1.13 #include "runtime/thread.inline.hpp" 1.14 +#include "runtime/objectMonitor.inline.hpp" 1.15 1.16 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 1.17 1.18 void markOopDesc::print_on(outputStream* st) const { 1.19 - if (is_locked()) { 1.20 - st->print("locked(" INTPTR_FORMAT ")->", value()); 1.21 - markOop(*(markOop*)value())->print_on(st); 1.22 + if (is_marked()) { 1.23 + st->print(" marked(" INTPTR_FORMAT ")", value()); 1.24 + } else if (is_locked()) { 1.25 + st->print(" locked(" INTPTR_FORMAT ")->", value()); 1.26 + if (is_neutral()) { 1.27 + st->print("is_neutral"); 1.28 + if (has_no_hash()) st->print(" no_hash"); 1.29 + else st->print(" hash=" INTPTR_FORMAT, hash()); 1.30 + st->print(" age=%d", age()); 1.31 + } else if (has_bias_pattern()) { 1.32 + st->print("is_biased"); 1.33 + JavaThread* jt = biased_locker(); 1.34 + st->print(" biased_locker=" INTPTR_FORMAT, p2i(jt)); 1.35 + } else if (has_monitor()) { 1.36 + ObjectMonitor* mon = monitor(); 1.37 + if (mon == NULL) 1.38 + st->print("monitor=NULL"); 1.39 + else { 1.40 + BasicLock * bl = (BasicLock *) mon->owner(); 1.41 + st->print("monitor={count="INTPTR_FORMAT",waiters="INTPTR_FORMAT",recursions="INTPTR_FORMAT",owner="INTPTR_FORMAT"}", 1.42 + mon->count(), mon->waiters(), mon->recursions(), p2i(bl)); 1.43 + } 1.44 + } else { 1.45 + st->print("??"); 1.46 + } 1.47 } else { 1.48 assert(is_unlocked() || has_bias_pattern(), "just checking"); 1.49 st->print("mark("); 1.50 - if (has_bias_pattern()) st->print("biased,"); 1.51 + if (has_bias_pattern()) st->print("biased,"); 1.52 st->print("hash %#lx,", hash()); 1.53 st->print("age %d)", age()); 1.54 }