207 if (!mons->is_empty()) { 208 bool found_first_monitor = false; 209 for (int index = (mons->length()-1); index >= 0; index--) { 210 MonitorInfo* monitor = mons->at(index); 211 if (monitor->eliminated() && is_compiled_frame()) { // Eliminated in compiled code 212 if (monitor->owner_is_scalar_replaced()) { 213 Klass* k = java_lang_Class::as_Klass(monitor->owner_klass()); 214 // format below for lockbits matches this one. 215 st->print("\t- eliminated <owner is scalar replaced> (a %s)", k->external_name()); 216 } else { 217 Handle obj(THREAD, monitor->owner()); 218 if (obj() != NULL) { 219 print_locked_object_class_name(st, obj, "eliminated"); 220 } 221 } 222 continue; 223 } 224 if (monitor->owner() != NULL) { 225 // the monitor is associated with an object, i.e., it is locked 226 227 markWord mark(0); 228 const char *lock_state = "locked"; // assume we have the monitor locked 229 if (!found_first_monitor && frame_count == 0) { 230 // If this is the first frame and we haven't found an owned 231 // monitor before, then we need to see if we have completed 232 // the lock or if we are blocked trying to acquire it. Only 233 // an inflated monitor that is first on the monitor list in 234 // the first frame can block us on a monitor enter. 235 mark = monitor->owner()->mark(); 236 if (mark.has_monitor() && 237 ( // we have marked ourself as pending on this monitor 238 mark.monitor() == thread()->current_pending_monitor() || 239 // we are not the owner of this monitor 240 !mark.monitor()->is_entered(thread()) 241 )) { 242 lock_state = "waiting to lock"; 243 } else { 244 // We own the monitor which is not as interesting so 245 // disable the extra printing below. 246 mark = markWord(0); 247 } 248 } 249 print_locked_object_class_name(st, Handle(THREAD, monitor->owner()), lock_state); 250 251 found_first_monitor = true; 252 } 253 } 254 } 255 } 256 257 // ------------- interpretedVFrame -------------- 258 259 u_char* interpretedVFrame::bcp() const { 260 return fr().interpreter_frame_bcp(); 261 } 262 263 void interpretedVFrame::set_bcp(u_char* bcp) { 264 fr().interpreter_frame_set_bcp(bcp); 265 } 266 | 207 if (!mons->is_empty()) { 208 bool found_first_monitor = false; 209 for (int index = (mons->length()-1); index >= 0; index--) { 210 MonitorInfo* monitor = mons->at(index); 211 if (monitor->eliminated() && is_compiled_frame()) { // Eliminated in compiled code 212 if (monitor->owner_is_scalar_replaced()) { 213 Klass* k = java_lang_Class::as_Klass(monitor->owner_klass()); 214 // format below for lockbits matches this one. 215 st->print("\t- eliminated <owner is scalar replaced> (a %s)", k->external_name()); 216 } else { 217 Handle obj(THREAD, monitor->owner()); 218 if (obj() != NULL) { 219 print_locked_object_class_name(st, obj, "eliminated"); 220 } 221 } 222 continue; 223 } 224 if (monitor->owner() != NULL) { 225 // the monitor is associated with an object, i.e., it is locked 226 227 markWord mark(markWord::zero); 228 const char *lock_state = "locked"; // assume we have the monitor locked 229 if (!found_first_monitor && frame_count == 0) { 230 // If this is the first frame and we haven't found an owned 231 // monitor before, then we need to see if we have completed 232 // the lock or if we are blocked trying to acquire it. Only 233 // an inflated monitor that is first on the monitor list in 234 // the first frame can block us on a monitor enter. 235 mark = monitor->owner()->mark(); 236 if (mark.has_monitor() && 237 ( // we have marked ourself as pending on this monitor 238 mark.monitor() == thread()->current_pending_monitor() || 239 // we are not the owner of this monitor 240 !mark.monitor()->is_entered(thread()) 241 )) { 242 lock_state = "waiting to lock"; 243 } else { 244 // FIXME: mark is set but not used below. 245 // Either the comment or the code is broken. 246 247 // We own the monitor which is not as interesting so 248 // disable the extra printing below. 249 mark = markWord(markWord::zero); 250 } 251 } 252 print_locked_object_class_name(st, Handle(THREAD, monitor->owner()), lock_state); 253 254 found_first_monitor = true; 255 } 256 } 257 } 258 } 259 260 // ------------- interpretedVFrame -------------- 261 262 u_char* interpretedVFrame::bcp() const { 263 return fr().interpreter_frame_bcp(); 264 } 265 266 void interpretedVFrame::set_bcp(u_char* bcp) { 267 fr().interpreter_frame_set_bcp(bcp); 268 } 269 |