hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp
changeset 12381 1438e0fbfa27
parent 12379 2cf45b79ce3a
child 12382 6aaecb1cbfe1
equal deleted inserted replaced
12380:48f69987dbca 12381:1438e0fbfa27
    50 class HeapRegionRemSet;
    50 class HeapRegionRemSet;
    51 class HeapRegionRemSetIterator;
    51 class HeapRegionRemSetIterator;
    52 class HeapRegion;
    52 class HeapRegion;
    53 class HeapRegionSetBase;
    53 class HeapRegionSetBase;
    54 
    54 
    55 #define HR_FORMAT SIZE_FORMAT":(%s)["PTR_FORMAT","PTR_FORMAT","PTR_FORMAT"]"
    55 #define HR_FORMAT "%u:(%s)["PTR_FORMAT","PTR_FORMAT","PTR_FORMAT"]"
    56 #define HR_FORMAT_PARAMS(_hr_) \
    56 #define HR_FORMAT_PARAMS(_hr_) \
    57                 (_hr_)->hrs_index(), \
    57                 (_hr_)->hrs_index(), \
    58                 (_hr_)->is_survivor() ? "S" : (_hr_)->is_young() ? "E" : "-", \
    58                 (_hr_)->is_survivor() ? "S" : (_hr_)->is_young() ? "E" : "-", \
    59                 (_hr_)->bottom(), (_hr_)->top(), (_hr_)->end()
    59                 (_hr_)->bottom(), (_hr_)->top(), (_hr_)->end()
       
    60 
       
    61 // sentinel value for hrs_index
       
    62 #define G1_NULL_HRS_INDEX ((uint) -1)
    60 
    63 
    61 // A dirty card to oop closure for heap regions. It
    64 // A dirty card to oop closure for heap regions. It
    62 // knows how to get the G1 heap and how to use the bitmap
    65 // knows how to get the G1 heap and how to use the bitmap
    63 // in the concurrent marker used by G1 to filter remembered
    66 // in the concurrent marker used by G1 to filter remembered
    64 // sets.
    67 // sets.
   233 
   236 
   234   G1BlockOffsetArrayContigSpace* offsets() { return &_offsets; }
   237   G1BlockOffsetArrayContigSpace* offsets() { return &_offsets; }
   235 
   238 
   236  protected:
   239  protected:
   237   // The index of this region in the heap region sequence.
   240   // The index of this region in the heap region sequence.
   238   size_t  _hrs_index;
   241   uint  _hrs_index;
   239 
   242 
   240   HumongousType _humongous_type;
   243   HumongousType _humongous_type;
   241   // For a humongous region, region in which it starts.
   244   // For a humongous region, region in which it starts.
   242   HeapRegion* _humongous_start_region;
   245   HeapRegion* _humongous_start_region;
   243   // For the start region of a humongous sequence, it's original end().
   246   // For the start region of a humongous sequence, it's original end().
   340   // the total value for the collection set.
   343   // the total value for the collection set.
   341   size_t _predicted_bytes_to_copy;
   344   size_t _predicted_bytes_to_copy;
   342 
   345 
   343  public:
   346  public:
   344   // If "is_zeroed" is "true", the region "mr" can be assumed to contain zeros.
   347   // If "is_zeroed" is "true", the region "mr" can be assumed to contain zeros.
   345   HeapRegion(size_t hrs_index,
   348   HeapRegion(uint hrs_index,
   346              G1BlockOffsetSharedArray* sharedOffsetArray,
   349              G1BlockOffsetSharedArray* sharedOffsetArray,
   347              MemRegion mr, bool is_zeroed);
   350              MemRegion mr, bool is_zeroed);
   348 
   351 
   349   static int    LogOfHRGrainBytes;
   352   static int    LogOfHRGrainBytes;
   350   static int    LogOfHRGrainWords;
   353   static int    LogOfHRGrainWords;
   387     return ContiguousSpace::allocate(word_size);
   390     return ContiguousSpace::allocate(word_size);
   388   }
   391   }
   389 
   392 
   390   // If this region is a member of a HeapRegionSeq, the index in that
   393   // If this region is a member of a HeapRegionSeq, the index in that
   391   // sequence, otherwise -1.
   394   // sequence, otherwise -1.
   392   size_t hrs_index() const { return _hrs_index; }
   395   uint hrs_index() const { return _hrs_index; }
   393 
   396 
   394   // The number of bytes marked live in the region in the last marking phase.
   397   // The number of bytes marked live in the region in the last marking phase.
   395   size_t marked_bytes()    { return _prev_marked_bytes; }
   398   size_t marked_bytes()    { return _prev_marked_bytes; }
   396   size_t live_bytes() {
   399   size_t live_bytes() {
   397     return (top() - prev_top_at_mark_start()) * HeapWordSize + marked_bytes();
   400     return (top() - prev_top_at_mark_start()) * HeapWordSize + marked_bytes();