提交 35d4d219 编写于 作者: T tschatzl

8054808: Bitmap verification sometimes fails after Full GC aborts concurrent mark.

Summary: The verification code that checked whether no bitmap mark had been found re-read HeapRegion::end() after the check on the bitmap. Concurrent humongous object allocation could have changed HeapRegion::end() in the meantime. Fix this by using the actual end of the region instead of HeapRegion::end() for comparison.
Reviewed-by: brutisso, jmasa
上级 fad45790
...@@ -887,7 +887,16 @@ class CheckBitmapClearHRClosure : public HeapRegionClosure { ...@@ -887,7 +887,16 @@ class CheckBitmapClearHRClosure : public HeapRegionClosure {
} }
virtual bool doHeapRegion(HeapRegion* r) { virtual bool doHeapRegion(HeapRegion* r) {
return _bitmap->getNextMarkedWordAddress(r->bottom(), r->end()) != r->end(); // This closure can be called concurrently to the mutator, so we must make sure
// that the result of the getNextMarkedWordAddress() call is compared to the
// value passed to it as limit to detect any found bits.
// We can use the region's orig_end() for the limit and the comparison value
// as it always contains the "real" end of the region that never changes and
// has no side effects.
// Due to the latter, there can also be no problem with the compiler generating
// reloads of the orig_end() call.
HeapWord* end = r->orig_end();
return _bitmap->getNextMarkedWordAddress(r->bottom(), end) != end;
} }
}; };
......
...@@ -570,7 +570,7 @@ class HeapRegion: public G1OffsetTableContigSpace { ...@@ -570,7 +570,7 @@ class HeapRegion: public G1OffsetTableContigSpace {
void set_next_dirty_cards_region(HeapRegion* hr) { _next_dirty_cards_region = hr; } void set_next_dirty_cards_region(HeapRegion* hr) { _next_dirty_cards_region = hr; }
bool is_on_dirty_cards_region_list() const { return get_next_dirty_cards_region() != NULL; } bool is_on_dirty_cards_region_list() const { return get_next_dirty_cards_region() != NULL; }
HeapWord* orig_end() { return _orig_end; } HeapWord* orig_end() const { return _orig_end; }
// Reset HR stuff to default values. // Reset HR stuff to default values.
void hr_clear(bool par, bool clear_space, bool locked = false); void hr_clear(bool par, bool clear_space, bool locked = false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册