Skip to content

Commit e9321cd

Browse files
committed
8263964: Redundant check in ObjectStartArray::object_starts_in_range
Reviewed-by: sjohanss, tschatzl
1 parent bd7a184 commit e9321cd

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/hotspot/share/gc/parallel/objectStartArray.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ bool ObjectStartArray::object_starts_in_range(HeapWord* start_addr,
129129
assert(start_addr <= end_addr,
130130
"Range is wrong. start_addr (" PTR_FORMAT ") is after end_addr (" PTR_FORMAT ")",
131131
p2i(start_addr), p2i(end_addr));
132-
if (start_addr > end_addr) {
133-
return false;
134-
}
135132

136133
jbyte* start_block = block_for_addr(start_addr);
137134
jbyte* end_block = block_for_addr(end_addr);

src/hotspot/share/gc/parallel/objectStartArray.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class ObjectStartArray : public CHeapObj<mtGC> {
8484
// Mapping that includes the derived offset.
8585
// If the block is clean, returns the last address in the covered region.
8686
// If the block is < index 0, returns the start of the covered region.
87-
HeapWord* offset_addr_for_block (jbyte* p) const {
87+
HeapWord* offset_addr_for_block(jbyte* p) const {
8888
// We have to do this before the assert
8989
if (p < _raw_base) {
9090
return _covered_region.start();
@@ -144,10 +144,7 @@ class ObjectStartArray : public CHeapObj<mtGC> {
144144
bool is_block_allocated(HeapWord* addr) {
145145
assert_covered_region_contains(addr);
146146
jbyte* block = block_for_addr(addr);
147-
if (*block == clean_block)
148-
return false;
149-
150-
return true;
147+
return *block != clean_block;
151148
}
152149

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

0 commit comments

Comments
 (0)