src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8047290SUPERfinal Sdiff src/share/vm/gc_implementation/concurrentMarkSweep

src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp

Print this page




6371   }
6372   assert(sz > 0, "size must be nonzero");
6373   HeapWord* next_block = addr + sz;
6374   HeapWord* next_card  = (HeapWord*)round_to((uintptr_t)next_block,
6375                                              CardTableModRefBS::card_size);
6376   assert(round_down((uintptr_t)addr,      CardTableModRefBS::card_size) <
6377          round_down((uintptr_t)next_card, CardTableModRefBS::card_size),
6378          "must be different cards");
6379   return next_card;
6380 }
6381 
6382 
6383 // CMS Bit Map Wrapper /////////////////////////////////////////
6384 
6385 // Construct a CMS bit map infrastructure, but don't create the
6386 // bit vector itself. That is done by a separate call CMSBitMap::allocate()
6387 // further below.
6388 CMSBitMap::CMSBitMap(int shifter, int mutex_rank, const char* mutex_name):
6389   _bm(),
6390   _shifter(shifter),
6391   _lock(mutex_rank >= 0 ? new Mutex(mutex_rank, mutex_name, true) : NULL)

6392 {
6393   _bmStartWord = 0;
6394   _bmWordSize  = 0;
6395 }
6396 
6397 bool CMSBitMap::allocate(MemRegion mr) {
6398   _bmStartWord = mr.start();
6399   _bmWordSize  = mr.word_size();
6400   ReservedSpace brs(ReservedSpace::allocation_align_size_up(
6401                      (_bmWordSize >> (_shifter + LogBitsPerByte)) + 1));
6402   if (!brs.is_reserved()) {
6403     warning("CMS bit map allocation failure");
6404     return false;
6405   }
6406   // For now we'll just commit all of the bit map up front.
6407   // Later on we'll try to be more parsimonious with swap.
6408   if (!_virtual_space.initialize(brs, brs.size())) {
6409     warning("CMS bit map backing store failure");
6410     return false;
6411   }




6371   }
6372   assert(sz > 0, "size must be nonzero");
6373   HeapWord* next_block = addr + sz;
6374   HeapWord* next_card  = (HeapWord*)round_to((uintptr_t)next_block,
6375                                              CardTableModRefBS::card_size);
6376   assert(round_down((uintptr_t)addr,      CardTableModRefBS::card_size) <
6377          round_down((uintptr_t)next_card, CardTableModRefBS::card_size),
6378          "must be different cards");
6379   return next_card;
6380 }
6381 
6382 
6383 // CMS Bit Map Wrapper /////////////////////////////////////////
6384 
6385 // Construct a CMS bit map infrastructure, but don't create the
6386 // bit vector itself. That is done by a separate call CMSBitMap::allocate()
6387 // further below.
6388 CMSBitMap::CMSBitMap(int shifter, int mutex_rank, const char* mutex_name):
6389   _bm(),
6390   _shifter(shifter),
6391   _lock(mutex_rank >= 0 ? new Mutex(mutex_rank, mutex_name, true ,
6392                                     Monitor::_safepoint_check_sometimes) : NULL)
6393 {
6394   _bmStartWord = 0;
6395   _bmWordSize  = 0;
6396 }
6397 
6398 bool CMSBitMap::allocate(MemRegion mr) {
6399   _bmStartWord = mr.start();
6400   _bmWordSize  = mr.word_size();
6401   ReservedSpace brs(ReservedSpace::allocation_align_size_up(
6402                      (_bmWordSize >> (_shifter + LogBitsPerByte)) + 1));
6403   if (!brs.is_reserved()) {
6404     warning("CMS bit map allocation failure");
6405     return false;
6406   }
6407   // For now we'll just commit all of the bit map up front.
6408   // Later on we'll try to be more parsimonious with swap.
6409   if (!_virtual_space.initialize(brs, brs.size())) {
6410     warning("CMS bit map backing store failure");
6411     return false;
6412   }


src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File