< prev index next >

src/share/vm/gc/cms/compactibleFreeListSpace.hpp

Print this page
rev 8362 : 8079792: GC directory structure cleanup
Reviewed-by:


   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_COMPACTIBLEFREELISTSPACE_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_COMPACTIBLEFREELISTSPACE_HPP
  27 
  28 #include "gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp"
  29 #include "gc_implementation/concurrentMarkSweep/promotionInfo.hpp"


  30 #include "memory/binaryTreeDictionary.hpp"
  31 #include "memory/blockOffsetTable.hpp"
  32 #include "memory/freeList.hpp"
  33 #include "memory/space.hpp"
  34 
  35 // Classes in support of keeping track of promotions into a non-Contiguous
  36 // space, in this case a CompactibleFreeListSpace.
  37 
  38 // Forward declarations
  39 class CMSCollector;
  40 class CompactibleFreeListSpace;
  41 class ConcurrentMarkSweepGeneration;
  42 class BlkClosure;
  43 class BlkClosureCareful;
  44 class FreeChunk;
  45 class UpwardsObjectClosure;
  46 class ObjectClosureCareful;
  47 class Klass;
  48 
  49 class LinearAllocBlock VALUE_OBJ_CLASS_SPEC {
  50  public:
  51   LinearAllocBlock() : _ptr(0), _word_size(0), _refillSize(0),
  52     _allocation_size_limit(0) {}
  53   void set(HeapWord* ptr, size_t word_size, size_t refill_size,


 703 
 704   // Allocate and return a block of the given size, or else return NULL.
 705   HeapWord* alloc(size_t word_sz);
 706 
 707   // Return any unused portions of the buffer to the global pool.
 708   void retire(int tid);
 709 
 710   // Dynamic OldPLABSize sizing
 711   static void compute_desired_plab_size();
 712   // When the settings are modified from default static initialization
 713   static void modify_initialization(size_t n, unsigned wt);
 714 };
 715 
 716 size_t PromotionInfo::refillSize() const {
 717   const size_t CMSSpoolBlockSize = 256;
 718   const size_t sz = heap_word_size(sizeof(SpoolBlock) + sizeof(markOop)
 719                                    * CMSSpoolBlockSize);
 720   return CompactibleFreeListSpace::adjustObjectSize(sz);
 721 }
 722 
 723 #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_COMPACTIBLEFREELISTSPACE_HPP


   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_CMS_COMPACTIBLEFREELISTSPACE_HPP
  26 #define SHARE_VM_GC_CMS_COMPACTIBLEFREELISTSPACE_HPP
  27 
  28 #include "gc/cms/adaptiveFreeList.hpp"
  29 #include "gc/cms/promotionInfo.hpp"
  30 #include "gc/shared/blockOffsetTable.hpp"
  31 #include "gc/shared/space.hpp"
  32 #include "memory/binaryTreeDictionary.hpp"

  33 #include "memory/freeList.hpp"

  34 
  35 // Classes in support of keeping track of promotions into a non-Contiguous
  36 // space, in this case a CompactibleFreeListSpace.
  37 
  38 // Forward declarations
  39 class CMSCollector;
  40 class CompactibleFreeListSpace;
  41 class ConcurrentMarkSweepGeneration;
  42 class BlkClosure;
  43 class BlkClosureCareful;
  44 class FreeChunk;
  45 class UpwardsObjectClosure;
  46 class ObjectClosureCareful;
  47 class Klass;
  48 
  49 class LinearAllocBlock VALUE_OBJ_CLASS_SPEC {
  50  public:
  51   LinearAllocBlock() : _ptr(0), _word_size(0), _refillSize(0),
  52     _allocation_size_limit(0) {}
  53   void set(HeapWord* ptr, size_t word_size, size_t refill_size,


 703 
 704   // Allocate and return a block of the given size, or else return NULL.
 705   HeapWord* alloc(size_t word_sz);
 706 
 707   // Return any unused portions of the buffer to the global pool.
 708   void retire(int tid);
 709 
 710   // Dynamic OldPLABSize sizing
 711   static void compute_desired_plab_size();
 712   // When the settings are modified from default static initialization
 713   static void modify_initialization(size_t n, unsigned wt);
 714 };
 715 
 716 size_t PromotionInfo::refillSize() const {
 717   const size_t CMSSpoolBlockSize = 256;
 718   const size_t sz = heap_word_size(sizeof(SpoolBlock) + sizeof(markOop)
 719                                    * CMSSpoolBlockSize);
 720   return CompactibleFreeListSpace::adjustObjectSize(sz);
 721 }
 722 
 723 #endif // SHARE_VM_GC_CMS_COMPACTIBLEFREELISTSPACE_HPP
< prev index next >