< prev index next >

src/hotspot/share/runtime/os.cpp

Print this page
rev 50307 : [mq]: cont


1051     }
1052     nmethod* nm = b->as_nmethod_or_null();
1053     if (nm != NULL) {
1054       ResourceMark rm;
1055       st->print(INTPTR_FORMAT " is at entry_point+%d in (nmethod*)" INTPTR_FORMAT,
1056                 p2i(addr), (int)(addr - nm->entry_point()), p2i(nm));
1057       if (verbose) {
1058         st->print(" for ");
1059         nm->method()->print_value_on(st);
1060       }
1061       st->cr();
1062       nm->print_nmethod(verbose);
1063       return;
1064     }
1065     st->print_cr(INTPTR_FORMAT " is at code_begin+%d in ", p2i(addr), (int)(addr - b->code_begin()));
1066     b->print_on(st);
1067     return;
1068   }
1069 
1070   if (Universe::heap()->is_in(addr)) {
1071     HeapWord* p = Universe::heap()->block_start(addr);
1072     bool print = false;
1073     // If we couldn't find it it just may mean that heap wasn't parsable
1074     // See if we were just given an oop directly
1075     if (p != NULL && Universe::heap()->block_is_obj(p)) {
1076       print = true;
1077     } else if (p == NULL && oopDesc::is_oop(oop(addr))) {
1078       p = (HeapWord*) addr;
1079       print = true;
1080     }
1081     if (print) {
1082       if (p == (HeapWord*) addr) {
1083         st->print_cr(INTPTR_FORMAT " is an oop", p2i(addr));
1084       } else {
1085         st->print_cr(INTPTR_FORMAT " is pointing into object: " INTPTR_FORMAT, p2i(addr), p2i(p));
1086       }





1087       oop(p)->print_on(st);

1088       return;
1089     }
1090   } else {
1091     if (Universe::heap()->is_in_reserved(addr)) {
1092       st->print_cr(INTPTR_FORMAT " is an unallocated location "
1093                    "in the heap", p2i(addr));
1094       return;
1095     }
1096   }
1097   if (JNIHandles::is_global_handle((jobject) addr)) {
1098     st->print_cr(INTPTR_FORMAT " is a global jni handle", p2i(addr));
1099     return;
1100   }
1101   if (JNIHandles::is_weak_global_handle((jobject) addr)) {
1102     st->print_cr(INTPTR_FORMAT " is a weak global jni handle", p2i(addr));
1103     return;
1104   }
1105 #ifndef PRODUCT
1106   // we don't keep the block list in product mode
1107   if (JNIHandles::is_local_handle((jobject) addr)) {




1051     }
1052     nmethod* nm = b->as_nmethod_or_null();
1053     if (nm != NULL) {
1054       ResourceMark rm;
1055       st->print(INTPTR_FORMAT " is at entry_point+%d in (nmethod*)" INTPTR_FORMAT,
1056                 p2i(addr), (int)(addr - nm->entry_point()), p2i(nm));
1057       if (verbose) {
1058         st->print(" for ");
1059         nm->method()->print_value_on(st);
1060       }
1061       st->cr();
1062       nm->print_nmethod(verbose);
1063       return;
1064     }
1065     st->print_cr(INTPTR_FORMAT " is at code_begin+%d in ", p2i(addr), (int)(addr - b->code_begin()));
1066     b->print_on(st);
1067     return;
1068   }
1069 
1070   if (Universe::heap()->is_in(addr)) {
1071     HeapWord* p = NULL; // Universe::heap()->block_start(addr);
1072     bool print = false;
1073     // If we couldn't find it it just may mean that heap wasn't parsable
1074     // See if we were just given an oop directly
1075     if (p != NULL && Universe::heap()->block_is_obj(p)) {
1076       print = true;
1077     } else if (p == NULL && oopDesc::is_oop(oop(addr))) {
1078       p = (HeapWord*) addr;
1079       print = true;
1080     }
1081     if (print) {
1082       if (p == (HeapWord*) addr) {
1083         st->print_cr(INTPTR_FORMAT " is an oop", p2i(addr));
1084       } else {
1085         st->print_cr(INTPTR_FORMAT " is pointing into object: " INTPTR_FORMAT, p2i(addr), p2i(p));
1086       } 
1087       if (*((juint*)p) == badHeapWordVal) {
1088         st->print_cr(" Bad word");
1089       } else if (*((juint*)p) == badMetaWordVal) {
1090         st->print_cr(" Bad meta word");
1091       } else {
1092         oop(p)->print_on(st);
1093       }
1094       return;
1095     }
1096   } else {
1097     if (Universe::heap()->is_in_reserved(addr)) {
1098       st->print_cr(INTPTR_FORMAT " is an unallocated location "
1099                    "in the heap", p2i(addr));
1100       return;
1101     }
1102   }
1103   if (JNIHandles::is_global_handle((jobject) addr)) {
1104     st->print_cr(INTPTR_FORMAT " is a global jni handle", p2i(addr));
1105     return;
1106   }
1107   if (JNIHandles::is_weak_global_handle((jobject) addr)) {
1108     st->print_cr(INTPTR_FORMAT " is a weak global jni handle", p2i(addr));
1109     return;
1110   }
1111 #ifndef PRODUCT
1112   // we don't keep the block list in product mode
1113   if (JNIHandles::is_local_handle((jobject) addr)) {


< prev index next >