7097516: G1: assert(0<= from_card && from_card<HeapRegion::CardsPerRegion) failed: Must be in range
Introduced a version of is_in_reserved() that looks at _orig_end as opposed to _end. Reviewed-by: tonyp, stefank
This commit is contained in:
parent
cab4072f8d
commit
8fb3eec82e
@ -431,6 +431,14 @@ class HeapRegion: public G1OffsetTableContigSpace {
|
|||||||
return _humongous_start_region;
|
return _humongous_start_region;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Same as Space::is_in_reserved, but will use the original size of the region.
|
||||||
|
// The original size is different only for start humongous regions. They get
|
||||||
|
// their _end set up to be the end of the last continues region of the
|
||||||
|
// corresponding humongous object.
|
||||||
|
bool is_in_reserved_raw(const void* p) const {
|
||||||
|
return _bottom <= p && p < _orig_end;
|
||||||
|
}
|
||||||
|
|
||||||
// Makes the current region be a "starts humongous" region, i.e.,
|
// Makes the current region be a "starts humongous" region, i.e.,
|
||||||
// the first region in a series of one or more contiguous regions
|
// the first region in a series of one or more contiguous regions
|
||||||
// that will contain a single "humongous" object. The two parameters
|
// that will contain a single "humongous" object. The two parameters
|
||||||
|
@ -143,7 +143,11 @@ protected:
|
|||||||
// If the test below fails, then this table was reused concurrently
|
// If the test below fails, then this table was reused concurrently
|
||||||
// with this operation. This is OK, since the old table was coarsened,
|
// with this operation. This is OK, since the old table was coarsened,
|
||||||
// and adding a bit to the new table is never incorrect.
|
// and adding a bit to the new table is never incorrect.
|
||||||
if (loc_hr->is_in_reserved(from)) {
|
// If the table used to belong to a continues humongous region and is
|
||||||
|
// now reused for the corresponding start humongous region, we need to
|
||||||
|
// make sure that we detect this. Thus, we call is_in_reserved_raw()
|
||||||
|
// instead of just is_in_reserved() here.
|
||||||
|
if (loc_hr->is_in_reserved_raw(from)) {
|
||||||
size_t hw_offset = pointer_delta((HeapWord*)from, loc_hr->bottom());
|
size_t hw_offset = pointer_delta((HeapWord*)from, loc_hr->bottom());
|
||||||
CardIdx_t from_card = (CardIdx_t)
|
CardIdx_t from_card = (CardIdx_t)
|
||||||
hw_offset >> (CardTableModRefBS::card_shift - LogHeapWordSize);
|
hw_offset >> (CardTableModRefBS::card_shift - LogHeapWordSize);
|
||||||
|
Loading…
Reference in New Issue
Block a user