< prev index next >

src/hotspot/share/code/codeCache.cpp

Print this page

 546       ResourceMark rm;
 547       if (_nmethod_heaps->length() >= 1) {
 548         tty->print("%s", heap->name());
 549       } else {
 550         tty->print("CodeCache");
 551       }
 552       tty->print_cr(" extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" SSIZE_FORMAT " bytes)",
 553                     (intptr_t)heap->low_boundary(), (intptr_t)heap->high(),
 554                     (address)heap->high() - (address)heap->low_boundary());
 555     }
 556   }
 557   print_trace("allocation", cb, size);
 558   return cb;
 559 }
 560 
 561 void CodeCache::free(CodeBlob* cb) {
 562   assert_locked_or_safepoint(CodeCache_lock);
 563   CodeHeap* heap = get_code_heap(cb);
 564   print_trace("free", cb);
 565   if (cb->is_nmethod()) {
 566     nmethod* ptr = (nmethod *)cb;
 567     heap->set_nmethod_count(heap->nmethod_count() - 1);
 568     if (ptr->has_dependencies()) {
 569       _number_of_nmethods_with_dependencies--;
 570     }
 571     ptr->free_native_invokers();
 572   }
 573   if (cb->is_adapter_blob()) {
 574     heap->set_adapter_count(heap->adapter_count() - 1);
 575   }
 576 
 577   // Get heap for given CodeBlob and deallocate
 578   get_code_heap(cb)->deallocate(cb);
 579 
 580   assert(heap->blob_count() >= 0, "sanity check");
 581 }
 582 
 583 void CodeCache::free_unused_tail(CodeBlob* cb, size_t used) {
 584   assert_locked_or_safepoint(CodeCache_lock);
 585   guarantee(cb->is_buffer_blob() && strncmp("Interpreter", cb->name(), 11) == 0, "Only possible for interpreter!");
 586   print_trace("free_unused_tail", cb);
 587 
 588   // We also have to account for the extra space (i.e. header) used by the CodeBlob
 589   // which provides the memory (see BufferBlob::create() in codeBlob.cpp).
 590   used += CodeBlob::align_code_offset(cb->header_size());
 591 

 546       ResourceMark rm;
 547       if (_nmethod_heaps->length() >= 1) {
 548         tty->print("%s", heap->name());
 549       } else {
 550         tty->print("CodeCache");
 551       }
 552       tty->print_cr(" extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" SSIZE_FORMAT " bytes)",
 553                     (intptr_t)heap->low_boundary(), (intptr_t)heap->high(),
 554                     (address)heap->high() - (address)heap->low_boundary());
 555     }
 556   }
 557   print_trace("allocation", cb, size);
 558   return cb;
 559 }
 560 
 561 void CodeCache::free(CodeBlob* cb) {
 562   assert_locked_or_safepoint(CodeCache_lock);
 563   CodeHeap* heap = get_code_heap(cb);
 564   print_trace("free", cb);
 565   if (cb->is_nmethod()) {

 566     heap->set_nmethod_count(heap->nmethod_count() - 1);
 567     if (((nmethod *)cb)->has_dependencies()) {
 568       _number_of_nmethods_with_dependencies--;
 569     }

 570   }
 571   if (cb->is_adapter_blob()) {
 572     heap->set_adapter_count(heap->adapter_count() - 1);
 573   }
 574 
 575   // Get heap for given CodeBlob and deallocate
 576   get_code_heap(cb)->deallocate(cb);
 577 
 578   assert(heap->blob_count() >= 0, "sanity check");
 579 }
 580 
 581 void CodeCache::free_unused_tail(CodeBlob* cb, size_t used) {
 582   assert_locked_or_safepoint(CodeCache_lock);
 583   guarantee(cb->is_buffer_blob() && strncmp("Interpreter", cb->name(), 11) == 0, "Only possible for interpreter!");
 584   print_trace("free_unused_tail", cb);
 585 
 586   // We also have to account for the extra space (i.e. header) used by the CodeBlob
 587   // which provides the memory (see BufferBlob::create() in codeBlob.cpp).
 588   used += CodeBlob::align_code_offset(cb->header_size());
 589 
< prev index next >