< prev index next >

src/share/vm/runtime/os.cpp

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


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




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


< prev index next >