< prev index next >

src/hotspot/share/gc/g1/g1RegionToSpaceMapper.hpp

Print this page
rev 51649 : version 1
rev 52017 : All changes for G1 GC moved from 'combined' repo folder
rev 52487 : Worked on comments from Sangheon, Stefan


  70     return _commit_map.at(idx);
  71   }
  72 
  73   virtual void commit_regions(uint start_idx, size_t num_regions = 1, WorkGang* pretouch_workers = NULL) = 0;
  74   virtual void uncommit_regions(uint start_idx, size_t num_regions = 1) = 0;
  75 
  76   // Creates an appropriate G1RegionToSpaceMapper for the given parameters.
  77   // The actual space to be used within the given reservation is given by actual_size.
  78   // This is because some OSes need to round up the reservation size to guarantee
  79   // alignment of page_size.
  80   // The byte_translation_factor defines how many bytes in a region correspond to
  81   // a single byte in the data structure this mapper is for.
  82   // Eg. in the card table, this value corresponds to the size a single card
  83   // table entry corresponds to in the heap.
  84   static G1RegionToSpaceMapper* create_mapper(ReservedSpace rs,
  85                                               size_t actual_size,
  86                                               size_t page_size,
  87                                               size_t region_granularity,
  88                                               size_t byte_translation_factor,
  89                                               MemoryType type);







  90 };
  91 





















  92 #endif // SHARE_VM_GC_G1_G1REGIONTOSPACEMAPPER_HPP


  70     return _commit_map.at(idx);
  71   }
  72 
  73   virtual void commit_regions(uint start_idx, size_t num_regions = 1, WorkGang* pretouch_workers = NULL) = 0;
  74   virtual void uncommit_regions(uint start_idx, size_t num_regions = 1) = 0;
  75 
  76   // Creates an appropriate G1RegionToSpaceMapper for the given parameters.
  77   // The actual space to be used within the given reservation is given by actual_size.
  78   // This is because some OSes need to round up the reservation size to guarantee
  79   // alignment of page_size.
  80   // The byte_translation_factor defines how many bytes in a region correspond to
  81   // a single byte in the data structure this mapper is for.
  82   // Eg. in the card table, this value corresponds to the size a single card
  83   // table entry corresponds to in the heap.
  84   static G1RegionToSpaceMapper* create_mapper(ReservedSpace rs,
  85                                               size_t actual_size,
  86                                               size_t page_size,
  87                                               size_t region_granularity,
  88                                               size_t byte_translation_factor,
  89                                               MemoryType type);
  90 
  91   static G1RegionToSpaceMapper* create_heap_mapper(ReservedSpace rs,
  92                                                    size_t actual_size,
  93                                                    size_t page_size,
  94                                                    size_t region_granularity,
  95                                                    size_t byte_translation_factor,
  96                                                    MemoryType type);
  97 };
  98 
  99 // G1RegionToSpaceMapper implementation where 
 100 // part of space is mapped to dram and part to nv-dimm
 101 class G1RegionToHeteroSpaceMapper : public G1RegionToSpaceMapper {
 102 private:
 103   size_t _pages_per_region;
 104   G1RegionToSpaceMapper* _dram_mapper;
 105   uint _num_committed_dram;
 106   uint _num_committed_nvdimm;
 107   uint _start_index_of_nvdimm;
 108   uint _start_index_of_dram;
 109   bool _success;
 110 
 111 public:
 112   G1RegionToHeteroSpaceMapper(ReservedSpace rs, size_t used_size, size_t page_size, size_t region_granularity, size_t commit_factor, MemoryType type);
 113   uint num_committed_dram() const;
 114   uint num_committed_nvdimm() const;
 115   bool success() { return _success; }
 116 
 117   virtual void commit_regions(uint start_idx, size_t num_regions = 1, WorkGang* pretouch_workers = NULL);
 118   virtual void uncommit_regions(uint start_idx, size_t num_regions = 1);
 119 };
 120 #endif // SHARE_VM_GC_G1_G1REGIONTOSPACEMAPPER_HPP
< prev index next >