< prev index next >

src/share/vm/runtime/os.cpp

Print this page
rev 11777 : [mq]: gcinterface.patch


 952       }
 953     }
 954     nmethod* nm = b->as_nmethod_or_null();
 955     if (nm != NULL) {
 956       ResourceMark rm;
 957       st->print(INTPTR_FORMAT " is at entry_point+%d in (nmethod*)" INTPTR_FORMAT,
 958                 p2i(addr), (int)(addr - nm->entry_point()), p2i(nm));
 959       if (verbose) {
 960         st->print(" for ");
 961         nm->method()->print_value_on(st);
 962       }
 963       st->cr();
 964       nm->print_nmethod(verbose);
 965       return;
 966     }
 967     st->print_cr(INTPTR_FORMAT " is at code_begin+%d in ", p2i(addr), (int)(addr - b->code_begin()));
 968     b->print_on(st);
 969     return;
 970   }
 971 
 972   if (Universe::heap()->is_in(addr)) {
 973     HeapWord* p = Universe::heap()->block_start(addr);
 974     bool print = false;
 975     // If we couldn't find it it just may mean that heap wasn't parsable
 976     // See if we were just given an oop directly
 977     if (p != NULL && Universe::heap()->block_is_obj(p)) {
 978       print = true;
 979     } else if (p == NULL && ((oopDesc*)addr)->is_oop()) {
 980       p = (HeapWord*) addr;
 981       print = true;
 982     }
 983     if (print) {
 984       if (p == (HeapWord*) addr) {
 985         st->print_cr(INTPTR_FORMAT " is an oop", p2i(addr));
 986       } else {
 987         st->print_cr(INTPTR_FORMAT " is pointing into object: " INTPTR_FORMAT, p2i(addr), p2i(p));
 988       }
 989       oop(p)->print_on(st);
 990       return;
 991     }
 992   } else {
 993     if (Universe::heap()->is_in_reserved(addr)) {
 994       st->print_cr(INTPTR_FORMAT " is an unallocated location "
 995                    "in the heap", p2i(addr));
 996       return;
 997     }
 998   }
 999   if (JNIHandles::is_global_handle((jobject) addr)) {
1000     st->print_cr(INTPTR_FORMAT " is a global jni handle", p2i(addr));
1001     return;
1002   }
1003   if (JNIHandles::is_weak_global_handle((jobject) addr)) {
1004     st->print_cr(INTPTR_FORMAT " is a weak global jni handle", p2i(addr));
1005     return;
1006   }
1007 #ifndef PRODUCT
1008   // we don't keep the block list in product mode
1009   if (JNIHandleBlock::any_contains((jobject) addr)) {
1010     st->print_cr(INTPTR_FORMAT " is a local jni handle", p2i(addr));
1011     return;
1012   }
1013 #endif




 952       }
 953     }
 954     nmethod* nm = b->as_nmethod_or_null();
 955     if (nm != NULL) {
 956       ResourceMark rm;
 957       st->print(INTPTR_FORMAT " is at entry_point+%d in (nmethod*)" INTPTR_FORMAT,
 958                 p2i(addr), (int)(addr - nm->entry_point()), p2i(nm));
 959       if (verbose) {
 960         st->print(" for ");
 961         nm->method()->print_value_on(st);
 962       }
 963       st->cr();
 964       nm->print_nmethod(verbose);
 965       return;
 966     }
 967     st->print_cr(INTPTR_FORMAT " is at code_begin+%d in ", p2i(addr), (int)(addr - b->code_begin()));
 968     b->print_on(st);
 969     return;
 970   }
 971 
 972   if (GC::gc()->heap()->is_in(addr)) {
 973     HeapWord* p = GC::gc()->heap()->block_start(addr);
 974     bool print = false;
 975     // If we couldn't find it it just may mean that heap wasn't parsable
 976     // See if we were just given an oop directly
 977     if (p != NULL && GC::gc()->heap()->block_is_obj(p)) {
 978       print = true;
 979     } else if (p == NULL && ((oopDesc*)addr)->is_oop()) {
 980       p = (HeapWord*) addr;
 981       print = true;
 982     }
 983     if (print) {
 984       if (p == (HeapWord*) addr) {
 985         st->print_cr(INTPTR_FORMAT " is an oop", p2i(addr));
 986       } else {
 987         st->print_cr(INTPTR_FORMAT " is pointing into object: " INTPTR_FORMAT, p2i(addr), p2i(p));
 988       }
 989       oop(p)->print_on(st);
 990       return;
 991     }
 992   } else {
 993     if (GC::gc()->heap()->is_in_reserved(addr)) {
 994       st->print_cr(INTPTR_FORMAT " is an unallocated location "
 995                    "in the heap", p2i(addr));
 996       return;
 997     }
 998   }
 999   if (JNIHandles::is_global_handle((jobject) addr)) {
1000     st->print_cr(INTPTR_FORMAT " is a global jni handle", p2i(addr));
1001     return;
1002   }
1003   if (JNIHandles::is_weak_global_handle((jobject) addr)) {
1004     st->print_cr(INTPTR_FORMAT " is a weak global jni handle", p2i(addr));
1005     return;
1006   }
1007 #ifndef PRODUCT
1008   // we don't keep the block list in product mode
1009   if (JNIHandleBlock::any_contains((jobject) addr)) {
1010     st->print_cr(INTPTR_FORMAT " is a local jni handle", p2i(addr));
1011     return;
1012   }
1013 #endif


< prev index next >