src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp
changeset 55557 657924d1e2ba
parent 55539 734e58d8477b
child 57782 ca133d5ea78a
equal deleted inserted replaced
55556:19d0b382f086 55557:657924d1e2ba
   370     DEBUG_ONLY(
   370     DEBUG_ONLY(
   371       _indexedFreeList[i].set_protecting_lock(_indexedFreeListParLocks[i]);
   371       _indexedFreeList[i].set_protecting_lock(_indexedFreeListParLocks[i]);
   372     )
   372     )
   373   }
   373   }
   374   _dictionary->set_par_lock(&_parDictionaryAllocLock);
   374   _dictionary->set_par_lock(&_parDictionaryAllocLock);
   375 
       
   376   _used_stable = 0;
       
   377 }
   375 }
   378 
   376 
   379 // Like CompactibleSpace forward() but always calls cross_threshold() to
   377 // Like CompactibleSpace forward() but always calls cross_threshold() to
   380 // update the block offset table.  Removed initialize_threshold call because
   378 // update the block offset table.  Removed initialize_threshold call because
   381 // CFLS does not use a block offset array for contiguous spaces.
   379 // CFLS does not use a block offset array for contiguous spaces.
   575   return fc->is_free();
   573   return fc->is_free();
   576 }
   574 }
   577 
   575 
   578 size_t CompactibleFreeListSpace::used() const {
   576 size_t CompactibleFreeListSpace::used() const {
   579   return capacity() - free();
   577   return capacity() - free();
   580 }
       
   581 
       
   582 size_t CompactibleFreeListSpace::used_stable() const {
       
   583   return _used_stable;
       
   584 }
       
   585 
       
   586 void CompactibleFreeListSpace::recalculate_used_stable() {
       
   587   _used_stable = used();
       
   588 }
   578 }
   589 
   579 
   590 size_t CompactibleFreeListSpace::free() const {
   580 size_t CompactibleFreeListSpace::free() const {
   591   // "MT-safe, but not MT-precise"(TM), if you will: i.e.
   581   // "MT-safe, but not MT-precise"(TM), if you will: i.e.
   592   // if you do this while the structures are in flux you
   582   // if you do this while the structures are in flux you
  1381     _bt.verify_single_block(res, size);
  1371     _bt.verify_single_block(res, size);
  1382     _bt.verify_not_unallocated(res, size);
  1372     _bt.verify_not_unallocated(res, size);
  1383     // mangle a just allocated object with a distinct pattern.
  1373     // mangle a just allocated object with a distinct pattern.
  1384     debug_only(fc->mangleAllocated(size));
  1374     debug_only(fc->mangleAllocated(size));
  1385   }
  1375   }
  1386 
       
  1387   // After allocation, recalculate used space and update used_stable
       
  1388   recalculate_used_stable();
       
  1389 
  1376 
  1390   return res;
  1377   return res;
  1391 }
  1378 }
  1392 
  1379 
  1393 HeapWord* CompactibleFreeListSpace::allocate_adaptive_freelists(size_t size) {
  1380 HeapWord* CompactibleFreeListSpace::allocate_adaptive_freelists(size_t size) {