@@ -1106,16 +1106,28 @@ void PSParallelCompact::summarize_spaces_quick()
1106
1106
}
1107
1107
1108
1108
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" );
1113
1122
#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.
1117
1125
return ;
1118
1126
#endif
1127
+ if (MinObjAlignment > 1 ) {
1128
+ return ;
1129
+ }
1130
+ assert (CollectedHeap::min_fill_size () == 2 , " inv" );
1119
1131
HeapWord* const dense_prefix_end = dense_prefix (id);
1120
1132
RegionData* const region_after_dense_prefix = _summary_data.addr_to_region_ptr (dense_prefix_end);
1121
1133
idx_t const dense_prefix_bit = _mark_bitmap.addr_to_bit (dense_prefix_end);
1 commit comments
openjdk-notifier[bot] commentedon Mar 22, 2024
Review
Issues