hotspot/src/share/vm/compiler/compileBroker.cpp
changeset 9975 82190b49ce14
parent 9343 cf46e123429d
child 10739 91935236600e
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp	Wed Jun 01 23:25:31 2011 -0700
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp	Thu Jun 02 13:36:11 2011 -0700
@@ -300,12 +300,23 @@
   st->print("%7d ", (int) st->time_stamp().milliseconds());  // print timestamp
   st->print("%4d ", compile_id);    // print compilation number
 
+  // For unloaded methods the transition to zombie occurs after the
+  // method is cleared so it's impossible to report accurate
+  // information for that case.
+  bool is_synchronized = false;
+  bool has_exception_handler = false;
+  bool is_native = false;
+  if (method != NULL) {
+    is_synchronized       = method->is_synchronized();
+    has_exception_handler = method->has_exception_handler();
+    is_native             = method->is_native();
+  }
   // method attributes
   const char compile_type   = is_osr_method                   ? '%' : ' ';
-  const char sync_char      = method->is_synchronized()       ? 's' : ' ';
-  const char exception_char = method->has_exception_handler() ? '!' : ' ';
+  const char sync_char      = is_synchronized                 ? 's' : ' ';
+  const char exception_char = has_exception_handler           ? '!' : ' ';
   const char blocking_char  = is_blocking                     ? 'b' : ' ';
-  const char native_char    = method->is_native()             ? 'n' : ' ';
+  const char native_char    = is_native                       ? 'n' : ' ';
 
   // print method attributes
   st->print("%c%c%c%c%c ", compile_type, sync_char, exception_char, blocking_char, native_char);
@@ -316,11 +327,15 @@
   }
   st->print("     ");  // more indent
 
-  method->print_short_name(st);
-  if (is_osr_method) {
-    st->print(" @ %d", osr_bci);
+  if (method == NULL) {
+    st->print("(method)");
+  } else {
+    method->print_short_name(st);
+    if (is_osr_method) {
+      st->print(" @ %d", osr_bci);
+    }
+    st->print(" (%d bytes)", method->code_size());
   }
-  st->print(" (%d bytes)", method->code_size());
 
   if (msg != NULL) {
     st->print("   %s", msg);