6624765: Guarantee failure "Unexpected dirty card found"

In verification take into account partial coverage of a region by a card and expansion of the card table.

Reviewed-by: ysr, apetrusenko
This commit is contained in:
Jon Masamitsu 2008-02-15 07:01:10 -08:00
parent 41895dc06d
commit 38fdc8ab98
6 changed files with 32 additions and 15 deletions

View file

@ -556,10 +556,16 @@ void CardTableRS::verify() {
}
void CardTableRS::verify_empty(MemRegion mr) {
void CardTableRS::verify_aligned_region_empty(MemRegion mr) {
if (!mr.is_empty()) {
jbyte* cur_entry = byte_for(mr.start());
jbyte* limit = byte_after(mr.last());
// The region mr may not start on a card boundary so
// the first card may reflect a write to the space
// just prior to mr.
if (!is_aligned(mr.start())) {
cur_entry++;
}
for (;cur_entry < limit; cur_entry++) {
guarantee(*cur_entry == CardTableModRefBS::clean_card,
"Unexpected dirty card found");