< prev index next >

src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp

Print this page
rev 9067 : 8139040: Fix initializations before ShouldNotReachHere()


7711   return size;
7712 }
7713 
7714 void SweepClosure::do_post_free_or_garbage_chunk(FreeChunk* fc,
7715                                                  size_t chunkSize) {
7716   // do_post_free_or_garbage_chunk() should only be called in the case
7717   // of the adaptive free list allocator.
7718   const bool fcInFreeLists = fc->is_free();
7719   assert(_sp->adaptive_freelists(), "Should only be used in this case.");
7720   assert((HeapWord*)fc <= _limit, "sweep invariant");
7721   if (CMSTestInFreeList && fcInFreeLists) {
7722     assert(_sp->verify_chunk_in_free_list(fc), "free chunk is not in free lists");
7723   }
7724 
7725   if (CMSTraceSweeper) {
7726     gclog_or_tty->print_cr("  -- pick up another chunk at " PTR_FORMAT " (" SIZE_FORMAT ")", p2i(fc), chunkSize);
7727   }
7728 
7729   HeapWord* const fc_addr = (HeapWord*) fc;
7730 
7731   bool coalesce;
7732   const size_t left  = pointer_delta(fc_addr, freeFinger());
7733   const size_t right = chunkSize;
7734   switch (FLSCoalescePolicy) {
7735     // numeric value forms a coalition aggressiveness metric
7736     case 0:  { // never coalesce
7737       coalesce = false;
7738       break;
7739     }
7740     case 1: { // coalesce if left & right chunks on overpopulated lists
7741       coalesce = _sp->coalOverPopulated(left) &&
7742                  _sp->coalOverPopulated(right);
7743       break;
7744     }
7745     case 2: { // coalesce if left chunk on overpopulated list (default)
7746       coalesce = _sp->coalOverPopulated(left);
7747       break;
7748     }
7749     case 3: { // coalesce if left OR right chunk on overpopulated list
7750       coalesce = _sp->coalOverPopulated(left) ||
7751                  _sp->coalOverPopulated(right);




7711   return size;
7712 }
7713 
7714 void SweepClosure::do_post_free_or_garbage_chunk(FreeChunk* fc,
7715                                                  size_t chunkSize) {
7716   // do_post_free_or_garbage_chunk() should only be called in the case
7717   // of the adaptive free list allocator.
7718   const bool fcInFreeLists = fc->is_free();
7719   assert(_sp->adaptive_freelists(), "Should only be used in this case.");
7720   assert((HeapWord*)fc <= _limit, "sweep invariant");
7721   if (CMSTestInFreeList && fcInFreeLists) {
7722     assert(_sp->verify_chunk_in_free_list(fc), "free chunk is not in free lists");
7723   }
7724 
7725   if (CMSTraceSweeper) {
7726     gclog_or_tty->print_cr("  -- pick up another chunk at " PTR_FORMAT " (" SIZE_FORMAT ")", p2i(fc), chunkSize);
7727   }
7728 
7729   HeapWord* const fc_addr = (HeapWord*) fc;
7730 
7731   bool coalesce = false;
7732   const size_t left  = pointer_delta(fc_addr, freeFinger());
7733   const size_t right = chunkSize;
7734   switch (FLSCoalescePolicy) {
7735     // numeric value forms a coalition aggressiveness metric
7736     case 0:  { // never coalesce
7737       coalesce = false;
7738       break;
7739     }
7740     case 1: { // coalesce if left & right chunks on overpopulated lists
7741       coalesce = _sp->coalOverPopulated(left) &&
7742                  _sp->coalOverPopulated(right);
7743       break;
7744     }
7745     case 2: { // coalesce if left chunk on overpopulated list (default)
7746       coalesce = _sp->coalOverPopulated(left);
7747       break;
7748     }
7749     case 3: { // coalesce if left OR right chunk on overpopulated list
7750       coalesce = _sp->coalOverPopulated(left) ||
7751                  _sp->coalOverPopulated(right);


< prev index next >