Skip to content
Permalink
Browse files
8263964: Redundant check in ObjectStartArray::object_starts_in_range
Reviewed-by: sjohanss, tschatzl
  • Loading branch information
albertnetymk committed Mar 23, 2021
1 parent bd7a184 commit e9321cdc41c56c9e1c08acb1d0bacf98b12a7458
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
@@ -129,9 +129,6 @@ bool ObjectStartArray::object_starts_in_range(HeapWord* start_addr,
assert(start_addr <= end_addr,
"Range is wrong. start_addr (" PTR_FORMAT ") is after end_addr (" PTR_FORMAT ")",
p2i(start_addr), p2i(end_addr));
if (start_addr > end_addr) {
return false;
}

jbyte* start_block = block_for_addr(start_addr);
jbyte* end_block = block_for_addr(end_addr);
@@ -84,7 +84,7 @@ class ObjectStartArray : public CHeapObj<mtGC> {
// Mapping that includes the derived offset.
// If the block is clean, returns the last address in the covered region.
// If the block is < index 0, returns the start of the covered region.
HeapWord* offset_addr_for_block (jbyte* p) const {
HeapWord* offset_addr_for_block(jbyte* p) const {
// We have to do this before the assert
if (p < _raw_base) {
return _covered_region.start();
@@ -144,10 +144,7 @@ class ObjectStartArray : public CHeapObj<mtGC> {
bool is_block_allocated(HeapWord* addr) {
assert_covered_region_contains(addr);
jbyte* block = block_for_addr(addr);
if (*block == clean_block)
return false;

return true;
return *block != clean_block;
}

// Return true if an object starts in the range of heap addresses.

0 comments on commit e9321cd

Please sign in to comment.