7097516: G1: assert(0<= from_card && from_card<HeapRegion::CardsPerRegion) failed: Must be in range.

Thu, 20 Oct 2011 10:21:35 +0200

author
brutisso
date
Thu, 20 Oct 2011 10:21:35 +0200
changeset 3216
5e5d4821bf07
parent 3210
bf2d2b8b1726
child 3217
8d161913dfc3

7097516: G1: assert(0<= from_card && from_card<HeapRegion::CardsPerRegion) failed: Must be in range.
Summary: Introduced a version of is_in_reserved() that looks at _orig_end as opposed to _end.
Reviewed-by: tonyp, stefank

src/share/vm/gc_implementation/g1/heapRegion.hpp file | annotate | diff | comparison | revisions
src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.hpp	Mon Oct 17 09:57:41 2011 -0700
     1.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp	Thu Oct 20 10:21:35 2011 +0200
     1.3 @@ -431,6 +431,14 @@
     1.4      return _humongous_start_region;
     1.5    }
     1.6  
     1.7 +  // Same as Space::is_in_reserved, but will use the original size of the region.
     1.8 +  // The original size is different only for start humongous regions. They get
     1.9 +  // their _end set up to be the end of the last continues region of the
    1.10 +  // corresponding humongous object.
    1.11 +  bool is_in_reserved_raw(const void* p) const {
    1.12 +    return _bottom <= p && p < _orig_end;
    1.13 +  }
    1.14 +
    1.15    // Makes the current region be a "starts humongous" region, i.e.,
    1.16    // the first region in a series of one or more contiguous regions
    1.17    // that will contain a single "humongous" object. The two parameters
     2.1 --- a/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp	Mon Oct 17 09:57:41 2011 -0700
     2.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp	Thu Oct 20 10:21:35 2011 +0200
     2.3 @@ -143,7 +143,11 @@
     2.4      // If the test below fails, then this table was reused concurrently
     2.5      // with this operation.  This is OK, since the old table was coarsened,
     2.6      // and adding a bit to the new table is never incorrect.
     2.7 -    if (loc_hr->is_in_reserved(from)) {
     2.8 +    // If the table used to belong to a continues humongous region and is
     2.9 +    // now reused for the corresponding start humongous region, we need to
    2.10 +    // make sure that we detect this. Thus, we call is_in_reserved_raw()
    2.11 +    // instead of just is_in_reserved() here.
    2.12 +    if (loc_hr->is_in_reserved_raw(from)) {
    2.13        size_t hw_offset = pointer_delta((HeapWord*)from, loc_hr->bottom());
    2.14        CardIdx_t from_card = (CardIdx_t)
    2.15            hw_offset >> (CardTableModRefBS::card_shift - LogHeapWordSize);

mercurial