8359825: Parallel: Simplify MutableNUMASpace::ensure_parsability

Reviewed-by: tschatzl, sangheki
This commit is contained in:
Albert Mingkun Yang 2025-06-19 19:43:24 +00:00
parent dec42bebb8
commit 0dd50dbb3e

View File

@ -92,18 +92,9 @@ void MutableNUMASpace::ensure_parsability() {
LGRPSpace *ls = lgrp_spaces()->at(i);
MutableSpace *s = ls->space();
if (s->top() < top()) { // For all spaces preceding the one containing top()
if (s->free_in_words() > 0) {
HeapWord* cur_top = s->top();
size_t words_left_to_fill = pointer_delta(s->end(), s->top());;
while (words_left_to_fill > 0) {
size_t words_to_fill = MIN2(words_left_to_fill, CollectedHeap::filler_array_max_size());
assert(words_to_fill >= CollectedHeap::min_fill_size(),
"Remaining size (%zu) is too small to fill (based on %zu and %zu)",
words_to_fill, words_left_to_fill, CollectedHeap::filler_array_max_size());
CollectedHeap::fill_with_object(cur_top, words_to_fill);
cur_top += words_to_fill;
words_left_to_fill -= words_to_fill;
}
size_t free_words = s->free_in_words();
if (free_words > 0) {
CollectedHeap::fill_with_objects(s->top(), free_words);
}
} else {
return;