8263964: Redundant check in ObjectStartArray::object_starts_in_range

Reviewed-by: sjohanss, tschatzl
This commit is contained in:
Albert Mingkun Yang 2021-03-23 13:40:48 +00:00
parent bd7a184b98
commit e9321cdc41
2 changed files with 2 additions and 8 deletions

View File

@ -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);

View File

@ -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.