8081629: CMS split_block() does not correctly fix up block-offset-table for large blocks

Reviewed-by: tschatzl, ysr
This commit is contained in:
Jon Masamitsu 2015-05-25 19:26:23 -07:00
parent c00b15bccd
commit 807c69046a

View File

@ -447,14 +447,16 @@ void BlockOffsetArrayNonContigSpace::split_block(HeapWord* blk,
} else {
// Unilaterally fix the first (num_pref_cards - 1) following
// the "offset card" in the suffix block.
const size_t right_most_fixed_index = suff_index + num_pref_cards - 1;
set_remainder_to_point_to_start_incl(suff_index + 1,
suff_index + num_pref_cards - 1, true /* reducing */);
right_most_fixed_index, true /* reducing */);
// Fix the appropriate cards in the remainder of the
// suffix block -- these are the last num_pref_cards
// cards in each power block of the "new" range plumbed
// from suff_addr.
bool more = true;
uint i = 1;
// Fix the first power block with back_by > num_pref_cards.
while (more && (i < N_powers)) {
size_t back_by = power_to_cards_back(i);
size_t right_index = suff_index + back_by - 1;
@ -463,6 +465,9 @@ void BlockOffsetArrayNonContigSpace::split_block(HeapWord* blk,
right_index = end_index - 1;
more = false;
}
if (left_index <= right_most_fixed_index) {
left_index = right_most_fixed_index + 1;
}
if (back_by > num_pref_cards) {
// Fill in the remainder of this "power block", if it
// is non-null.
@ -471,12 +476,14 @@ void BlockOffsetArrayNonContigSpace::split_block(HeapWord* blk,
N_words + i - 1, true /* reducing */);
} else {
more = false; // we are done
assert((end_index - 1) == right_index, "Must be at the end.");
}
i++;
break;
}
i++;
}
// Fix the rest of the power blocks.
while (more && (i < N_powers)) {
size_t back_by = power_to_cards_back(i);
size_t right_index = suff_index + back_by - 1;