src/share/vm/code/codeCache.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hs-comp Sdiff src/share/vm/code

src/share/vm/code/codeCache.cpp

Print this page
rev 7045 : 8058461: serviceability/dcmd/CodelistTest.java and serviceability/dcmd/CompilerQueueTest.java SIGSEGV
Summary: Print only alive nmethods and add lock to print compile queue
Reviewed-by:


 956                maxCodeCacheUsed/K, unallocated_capacity()/K);
 957 
 958   if (detailed) {
 959     st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]",
 960                  p2i(_heap->low_boundary()),
 961                  p2i(_heap->high()),
 962                  p2i(_heap->high_boundary()));
 963     st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT
 964                  " adapters=" UINT32_FORMAT,
 965                  nof_blobs(), nof_nmethods(), nof_adapters());
 966     st->print_cr(" compilation: %s", CompileBroker::should_compile_new_jobs() ?
 967                  "enabled" : Arguments::mode() == Arguments::_int ?
 968                  "disabled (interpreter mode)" :
 969                  "disabled (not enough contiguous free space left)");
 970   }
 971 }
 972 
 973 void CodeCache::print_codelist(outputStream* st) {
 974   assert_locked_or_safepoint(CodeCache_lock);
 975 
 976   FOR_ALL_NMETHODS(p) {
 977     ResourceMark rm;
 978     char *method_name = p->method()->name_and_sig_as_C_string();
 979     st->print_cr("%d %d %s ["INTPTR_FORMAT", "INTPTR_FORMAT" - "INTPTR_FORMAT"]",
 980                  p->compile_id(), p->comp_level(), method_name, (intptr_t)p->header_begin(),
 981                  (intptr_t)p->code_begin(), (intptr_t)p->code_end());
 982   }
 983 }
 984 
 985 void CodeCache::print_layout(outputStream* st) {
 986   assert_locked_or_safepoint(CodeCache_lock);
 987   ResourceMark rm;
 988 
 989   print_summary(st, true);
 990 }
 991 
 992 void CodeCache::log_state(outputStream* st) {
 993   st->print(" total_blobs='" UINT32_FORMAT "' nmethods='" UINT32_FORMAT "'"
 994             " adapters='" UINT32_FORMAT "' free_code_cache='" SIZE_FORMAT "'",
 995             nof_blobs(), nof_nmethods(), nof_adapters(),
 996             unallocated_capacity());


 956                maxCodeCacheUsed/K, unallocated_capacity()/K);
 957 
 958   if (detailed) {
 959     st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]",
 960                  p2i(_heap->low_boundary()),
 961                  p2i(_heap->high()),
 962                  p2i(_heap->high_boundary()));
 963     st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT
 964                  " adapters=" UINT32_FORMAT,
 965                  nof_blobs(), nof_nmethods(), nof_adapters());
 966     st->print_cr(" compilation: %s", CompileBroker::should_compile_new_jobs() ?
 967                  "enabled" : Arguments::mode() == Arguments::_int ?
 968                  "disabled (interpreter mode)" :
 969                  "disabled (not enough contiguous free space left)");
 970   }
 971 }
 972 
 973 void CodeCache::print_codelist(outputStream* st) {
 974   assert_locked_or_safepoint(CodeCache_lock);
 975 
 976   FOR_ALL_ALIVE_NMETHODS(p) {
 977     ResourceMark rm;
 978     char *method_name = p->method()->name_and_sig_as_C_string();
 979     st->print_cr("%d %d %s ["INTPTR_FORMAT", "INTPTR_FORMAT" - "INTPTR_FORMAT"]",
 980                  p->compile_id(), p->comp_level(), method_name, (intptr_t)p->header_begin(),
 981                  (intptr_t)p->code_begin(), (intptr_t)p->code_end());
 982   }
 983 }
 984 
 985 void CodeCache::print_layout(outputStream* st) {
 986   assert_locked_or_safepoint(CodeCache_lock);
 987   ResourceMark rm;
 988 
 989   print_summary(st, true);
 990 }
 991 
 992 void CodeCache::log_state(outputStream* st) {
 993   st->print(" total_blobs='" UINT32_FORMAT "' nmethods='" UINT32_FORMAT "'"
 994             " adapters='" UINT32_FORMAT "' free_code_cache='" SIZE_FORMAT "'",
 995             nof_blobs(), nof_nmethods(), nof_adapters(),
 996             unallocated_capacity());
src/share/vm/code/codeCache.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File