src/share/vm/gc_implementation/g1/heapRegion.hpp

changeset 3957
a2f7274eb6ef
parent 3731
8a2e5a6a19a4
child 4037
da91efe96a93
     1.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.hpp	Tue Jul 17 12:24:05 2012 -0700
     1.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp	Thu Jul 19 15:15:54 2012 -0700
     1.3 @@ -55,7 +55,10 @@
     1.4  #define HR_FORMAT "%u:(%s)["PTR_FORMAT","PTR_FORMAT","PTR_FORMAT"]"
     1.5  #define HR_FORMAT_PARAMS(_hr_) \
     1.6                  (_hr_)->hrs_index(), \
     1.7 -                (_hr_)->is_survivor() ? "S" : (_hr_)->is_young() ? "E" : "-", \
     1.8 +                (_hr_)->is_survivor() ? "S" : (_hr_)->is_young() ? "E" : \
     1.9 +                (_hr_)->startsHumongous() ? "HS" : \
    1.10 +                (_hr_)->continuesHumongous() ? "HC" : \
    1.11 +                !(_hr_)->is_empty() ? "O" : "F", \
    1.12                  (_hr_)->bottom(), (_hr_)->top(), (_hr_)->end()
    1.13  
    1.14  // sentinel value for hrs_index
    1.15 @@ -173,6 +176,7 @@
    1.16    virtual HeapWord* saved_mark_word() const;
    1.17    virtual void set_saved_mark();
    1.18    void reset_gc_time_stamp() { _gc_time_stamp = 0; }
    1.19 +  unsigned get_gc_time_stamp() { return _gc_time_stamp; }
    1.20  
    1.21    // See the comment above in the declaration of _pre_dummy_top for an
    1.22    // explanation of what it is.
    1.23 @@ -439,6 +443,25 @@
    1.24      return _humongous_start_region;
    1.25    }
    1.26  
    1.27 +  // Return the number of distinct regions that are covered by this region:
    1.28 +  // 1 if the region is not humongous, >= 1 if the region is humongous.
    1.29 +  uint region_num() const {
    1.30 +    if (!isHumongous()) {
    1.31 +      return 1U;
    1.32 +    } else {
    1.33 +      assert(startsHumongous(), "doesn't make sense on HC regions");
    1.34 +      assert(capacity() % HeapRegion::GrainBytes == 0, "sanity");
    1.35 +      return (uint) (capacity() >> HeapRegion::LogOfHRGrainBytes);
    1.36 +    }
    1.37 +  }
    1.38 +
    1.39 +  // Return the index + 1 of the last HC regions that's associated
    1.40 +  // with this HS region.
    1.41 +  uint last_hc_index() const {
    1.42 +    assert(startsHumongous(), "don't call this otherwise");
    1.43 +    return hrs_index() + region_num();
    1.44 +  }
    1.45 +
    1.46    // Same as Space::is_in_reserved, but will use the original size of the region.
    1.47    // The original size is different only for start humongous regions. They get
    1.48    // their _end set up to be the end of the last continues region of the
    1.49 @@ -622,8 +645,8 @@
    1.50    bool is_marked() { return _prev_top_at_mark_start != bottom(); }
    1.51  
    1.52    void reset_during_compaction() {
    1.53 -    guarantee( isHumongous() && startsHumongous(),
    1.54 -               "should only be called for humongous regions");
    1.55 +    assert(isHumongous() && startsHumongous(),
    1.56 +           "should only be called for starts humongous regions");
    1.57  
    1.58      zero_marked_bytes();
    1.59      init_top_at_mark_start();
    1.60 @@ -774,7 +797,7 @@
    1.61    virtual void oop_since_save_marks_iterate##nv_suffix(OopClosureType* cl);
    1.62    SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(HeapRegion_OOP_SINCE_SAVE_MARKS_DECL)
    1.63  
    1.64 -  CompactibleSpace* next_compaction_space() const;
    1.65 +  virtual CompactibleSpace* next_compaction_space() const;
    1.66  
    1.67    virtual void reset_after_compaction();
    1.68  

mercurial