src/hotspot/share/gc/g1/heapRegion.hpp
changeset 59220 72e15d757e6c
parent 59218 a1155217a563
equal deleted inserted replaced
59219:01cc6bb2a090 59220:72e15d757e6c
    65 // region may have top() equal the end of object if there isn't
    65 // region may have top() equal the end of object if there isn't
    66 // room for filler objects to pad out to the end of the region.
    66 // room for filler objects to pad out to the end of the region.
    67 class HeapRegion : public CHeapObj<mtGC> {
    67 class HeapRegion : public CHeapObj<mtGC> {
    68   friend class VMStructs;
    68   friend class VMStructs;
    69 
    69 
    70   HeapWord* _bottom;
    70   HeapWord* const _bottom;
    71   HeapWord* _end;
    71   HeapWord* const _end;
    72 
    72 
    73   HeapWord* volatile _top;
    73   HeapWord* volatile _top;
    74   HeapWord* _compaction_top;
    74   HeapWord* _compaction_top;
    75 
    75 
    76   G1BlockOffsetTablePart _bot_part;
    76   G1BlockOffsetTablePart _bot_part;
    82   // want to know where the end of the last "real" object we allocated
    82   // want to know where the end of the last "real" object we allocated
    83   // into the region was and this is what this keeps track.
    83   // into the region was and this is what this keeps track.
    84   HeapWord* _pre_dummy_top;
    84   HeapWord* _pre_dummy_top;
    85 
    85 
    86 public:
    86 public:
    87   void set_bottom(HeapWord* value) { _bottom = value; }
       
    88   HeapWord* bottom() const         { return _bottom; }
    87   HeapWord* bottom() const         { return _bottom; }
    89 
       
    90   void set_end(HeapWord* value)    { _end = value; }
       
    91   HeapWord* end() const            { return _end;    }
    88   HeapWord* end() const            { return _end;    }
    92 
    89 
    93   void set_compaction_top(HeapWord* compaction_top) { _compaction_top = compaction_top; }
    90   void set_compaction_top(HeapWord* compaction_top) { _compaction_top = compaction_top; }
    94   HeapWord* compaction_top() const { return _compaction_top; }
    91   HeapWord* compaction_top() const { return _compaction_top; }
    95 
    92 
   200 private:
   197 private:
   201   // The remembered set for this region.
   198   // The remembered set for this region.
   202   HeapRegionRemSet* _rem_set;
   199   HeapRegionRemSet* _rem_set;
   203 
   200 
   204   // Cached index of this region in the heap region sequence.
   201   // Cached index of this region in the heap region sequence.
   205   uint  _hrm_index;
   202   const uint _hrm_index;
   206 
   203 
   207   HeapRegionType _type;
   204   HeapRegionType _type;
   208 
   205 
   209   // For a humongous region, region in which it starts.
   206   // For a humongous region, region in which it starts.
   210   HeapRegion* _humongous_start_region;
   207   HeapRegion* _humongous_start_region;
   299 
   296 
   300   // Initializing the HeapRegion not only resets the data structure, but also
   297   // Initializing the HeapRegion not only resets the data structure, but also
   301   // resets the BOT for that heap region.
   298   // resets the BOT for that heap region.
   302   // The default values for clear_space means that we will do the clearing if
   299   // The default values for clear_space means that we will do the clearing if
   303   // there's clearing to be done ourselves. We also always mangle the space.
   300   // there's clearing to be done ourselves. We also always mangle the space.
   304   void initialize(MemRegion mr, bool clear_space = false, bool mangle_space = SpaceDecorator::Mangle);
   301   void initialize(bool clear_space = false, bool mangle_space = SpaceDecorator::Mangle);
   305 
   302 
   306   static int    LogOfHRGrainBytes;
   303   static int    LogOfHRGrainBytes;
   307   static int    LogOfHRGrainWords;
   304   static int    LogOfHRGrainWords;
   308   static int    LogCardsPerRegion;
   305   static int    LogCardsPerRegion;
   309 
   306