Skip to content

Commit

Permalink
8280030: [REDO] Parallel: More precise boundary in ObjectStartArray::…
Browse files Browse the repository at this point in the history
…object_starts_in_range

Reviewed-by: phh, zgu
Backport-of: 496baada1021eecae03e737afe838ad6d383cba9
  • Loading branch information
reinrich committed Mar 6, 2024
1 parent 47ec134 commit dbf4a99
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/hotspot/share/gc/parallel/objectStartArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,15 @@ bool ObjectStartArray::object_starts_in_range(HeapWord* start_addr,
"Range is wrong. start_addr (" PTR_FORMAT ") is after end_addr (" PTR_FORMAT ")",
p2i(start_addr), p2i(end_addr));

assert(is_aligned(start_addr, CardTable::card_size), "precondition");

if (start_addr == end_addr) {
// No objects in empty range.
return false;
}

jbyte* start_block = block_for_addr(start_addr);
jbyte* end_block = block_for_addr(end_addr);
jbyte* end_block = block_for_addr(end_addr - 1);

for (jbyte* block = start_block; block <= end_block; block++) {
if (*block != clean_block) {
Expand Down
8 changes: 5 additions & 3 deletions src/hotspot/share/gc/parallel/objectStartArray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,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, end_addr_aligned_up)
// where
// end_addr_aligned_up = align_up(end_addr, _card_size)
// Precondition: start_addr is card-size aligned
bool object_starts_in_range(HeapWord* start_addr, HeapWord* end_addr) const;
};

Expand Down

1 comment on commit dbf4a99

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.