Skip to content

Commit e06b568

Browse files
committedMar 22, 2024
8328602: Parallel: Incorrect assertion in fill_dense_prefix_end
Reviewed-by: gli, iwalulya
1 parent 528efe2 commit e06b568

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed
 

‎src/hotspot/share/gc/parallel/psParallelCompact.cpp

+19-7
Original file line numberDiff line numberDiff line change
@@ -1106,16 +1106,28 @@ void PSParallelCompact::summarize_spaces_quick()
11061106
}
11071107

11081108
void PSParallelCompact::fill_dense_prefix_end(SpaceId id) {
1109-
// Since both markword and klass takes 1 heap word, the min-obj-size is 2
1110-
// heap words.
1111-
// If min-fill-size decreases to 1, this whole method becomes redundant.
1112-
assert(CollectedHeap::min_fill_size() == 2, "inv");
1109+
// Comparing two sizes to decide if filling is required:
1110+
//
1111+
// The size of the filler (min-obj-size) is 2 heap words with the default
1112+
// MinObjAlignment, since both markword and klass take 1 heap word.
1113+
//
1114+
// The size of the gap (if any) right before dense-prefix-end is
1115+
// MinObjAlignment.
1116+
//
1117+
// Need to fill in the gap only if it's smaller than min-obj-size, and the
1118+
// filler obj will extend to next region.
1119+
1120+
// Note: If min-fill-size decreases to 1, this whole method becomes redundant.
1121+
assert(CollectedHeap::min_fill_size() >= 2, "inv");
11131122
#ifndef _LP64
1114-
// In 32-bit system, min-obj-alignment is >= 8 bytes, so the gap (if any)
1115-
// right before denses-prefix must be greater than min-fill-size; nothing to
1116-
// do.
1123+
// In 32-bit system, each heap word is 4 bytes, so MinObjAlignment == 2.
1124+
// The gap is always equal to min-fill-size, so nothing to do.
11171125
return;
11181126
#endif
1127+
if (MinObjAlignment > 1) {
1128+
return;
1129+
}
1130+
assert(CollectedHeap::min_fill_size() == 2, "inv");
11191131
HeapWord* const dense_prefix_end = dense_prefix(id);
11201132
RegionData* const region_after_dense_prefix = _summary_data.addr_to_region_ptr(dense_prefix_end);
11211133
idx_t const dense_prefix_bit = _mark_bitmap.addr_to_bit(dense_prefix_end);

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Mar 22, 2024

@openjdk-notifier[bot]
Please sign in to comment.