1.1 --- a/src/share/vm/runtime/vframe.cpp Wed Feb 11 18:56:26 2015 -0800 1.2 +++ b/src/share/vm/runtime/vframe.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 @@ -189,6 +189,7 @@ 1.11 if (monitor->eliminated() && is_compiled_frame()) { // Eliminated in compiled code 1.12 if (monitor->owner_is_scalar_replaced()) { 1.13 Klass* k = java_lang_Class::as_Klass(monitor->owner_klass()); 1.14 + // format below for lockbits matches this one. 1.15 st->print("\t- eliminated <owner is scalar replaced> (a %s)", k->external_name()); 1.16 } else { 1.17 oop obj = monitor->owner(); 1.18 @@ -206,9 +207,10 @@ 1.19 // see if we have completed the lock or we are blocked trying to 1.20 // acquire it - we can only be blocked if the monitor is inflated 1.21 1.22 + markOop mark = NULL; 1.23 const char *lock_state = "locked"; // assume we have the monitor locked 1.24 if (!found_first_monitor && frame_count == 0) { 1.25 - markOop mark = monitor->owner()->mark(); 1.26 + mark = monitor->owner()->mark(); 1.27 if (mark->has_monitor() && 1.28 ( // we have marked ourself as pending on this monitor 1.29 mark->monitor() == thread()->current_pending_monitor() || 1.30 @@ -216,11 +218,19 @@ 1.31 !mark->monitor()->is_entered(thread()) 1.32 )) { 1.33 lock_state = "waiting to lock"; 1.34 + } else { 1.35 + mark = NULL; // Disable printing below 1.36 } 1.37 } 1.38 + print_locked_object_class_name(st, monitor->owner(), lock_state); 1.39 + if (Verbose && mark != NULL) { 1.40 + // match with format above, replacing "-" with " ". 1.41 + st->print("\t lockbits="); 1.42 + mark->print_on(st); 1.43 + st->cr(); 1.44 + } 1.45 1.46 found_first_monitor = true; 1.47 - print_locked_object_class_name(st, monitor->owner(), lock_state); 1.48 } 1.49 } 1.50 } 1.51 @@ -578,10 +588,15 @@ 1.52 tty->print("( null )"); 1.53 } else { 1.54 monitor->owner()->print_value(); 1.55 - tty->print("(" INTPTR_FORMAT ")", (address)monitor->owner()); 1.56 + tty->print("(owner=" INTPTR_FORMAT ")", (address)monitor->owner()); 1.57 } 1.58 - if (monitor->eliminated() && is_compiled_frame()) 1.59 - tty->print(" ( lock is eliminated )"); 1.60 + if (monitor->eliminated()) { 1.61 + if(is_compiled_frame()) { 1.62 + tty->print(" ( lock is eliminated in compiled frame )"); 1.63 + } else { 1.64 + tty->print(" ( lock is eliminated, frame not compiled )"); 1.65 + } 1.66 + } 1.67 tty->cr(); 1.68 tty->print("\t "); 1.69 monitor->lock()->print_on(tty);