Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8263964: Redundant check in ObjectStartArray::object_starts_in_range #3117

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/hotspot/share/gc/parallel/objectStartArray.cpp
Original file line number Diff line number Diff line change
@@ -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);
7 changes: 2 additions & 5 deletions src/hotspot/share/gc/parallel/objectStartArray.hpp
Original file line number Diff line number Diff line change
@@ -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.