8279699: Parallel: More precise boundary in ObjectStartArray::object_starts_in_range

Reviewed-by: sjohanss, mli
This commit is contained in:
Albert Mingkun Yang 2022-01-14 07:47:08 +00:00
parent 35172cdaf3
commit 965c64bca7
2 changed files with 7 additions and 5 deletions
src/hotspot/share/gc/parallel

@ -133,9 +133,9 @@ bool ObjectStartArray::object_starts_in_range(HeapWord* start_addr,
p2i(start_addr), p2i(end_addr));
jbyte* start_block = block_for_addr(start_addr);
jbyte* end_block = block_for_addr(end_addr);
jbyte* end_block = block_for_addr(align_up(end_addr, _card_size));
for (jbyte* block = start_block; block <= end_block; block++) {
for (jbyte* block = start_block; block < end_block; block++) {
if (*block != clean_block) {
return true;
}

@ -165,9 +165,11 @@ class ObjectStartArray : public CHeapObj<mtGC> {
return *block != clean_block;
}
// Return true if an object starts in the range of heap addresses.
// If an object starts at an address corresponding to
// "start", the method will return true.
// Return true iff an object starts in
// [start_addr_aligned_down, end_addr_aligned_up)
// where
// start_addr_aligned_down = align_down(start_addr, _card_size)
// end_addr_aligned_up = align_up(end_addr, _card_size)
bool object_starts_in_range(HeapWord* start_addr, HeapWord* end_addr) const;
};