Skip to content
Permalink
Browse files
8278289: Drop G1BlockOffsetTablePart::_object_can_span
Reviewed-by: tschatzl, sjohanss, mli
  • Loading branch information
albertnetymk committed Dec 7, 2021
1 parent b2638e5 commit 44fcee3830466e34656ea553d10a60fc382c85a6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
@@ -75,7 +75,6 @@ void G1BlockOffsetTable::check_index(size_t index, const char* msg) const {

G1BlockOffsetTablePart::G1BlockOffsetTablePart(G1BlockOffsetTable* array, HeapRegion* hr) :
_next_offset_threshold(NULL),
DEBUG_ONLY(_object_can_span(false) COMMA)
_bot(array),
_hr(hr)
{
@@ -331,12 +330,6 @@ void G1BlockOffsetTablePart::verify() const {
}
}

#ifdef ASSERT
void G1BlockOffsetTablePart::set_object_can_span(bool can_span) {
_object_can_span = can_span;
}
#endif

#ifndef PRODUCT
void G1BlockOffsetTablePart::print_on(outputStream* out) {
size_t from_index = _bot->index_for(_hr->bottom());
@@ -114,9 +114,6 @@ class G1BlockOffsetTablePart {
// allocation boundary at which offset array must be updated
HeapWord* _next_offset_threshold;

// Indicates if an object can span into this G1BlockOffsetTablePart.
debug_only(bool _object_can_span;)

// This is the global BlockOffsetTable.
G1BlockOffsetTable* _bot;

@@ -212,7 +209,6 @@ class G1BlockOffsetTablePart {
}

void set_for_starts_humongous(HeapWord* obj_top, size_t fill_size);
void set_object_can_span(bool can_span) NOT_DEBUG_RETURN;

void print_on(outputStream* out) PRODUCT_RETURN;
};
@@ -113,9 +113,14 @@ inline size_t G1BlockOffsetTablePart::block_size(const HeapWord* p) const {
}

inline HeapWord* G1BlockOffsetTablePart::block_at_or_preceding(const void* addr) const {
assert(_object_can_span || _bot->offset_array(_bot->index_for(_hr->bottom())) == 0,
"Object crossed region boundary, found offset %u instead of 0",
(uint) _bot->offset_array(_bot->index_for(_hr->bottom())));
#ifdef ASSERT
if (!_hr->is_continues_humongous()) {
// For non-ContinuesHumongous regions, the first obj always starts from bottom.
u_char offset = _bot->offset_array(_bot->index_for(_hr->bottom()));
assert(offset == 0, "Found offset %u instead of 0 for region %u %s",
offset, _hr->hrm_index(), _hr->get_short_type_str());
}
#endif

size_t index = _bot->index_for(addr);

@@ -214,17 +214,13 @@ void HeapRegion::set_continues_humongous(HeapRegion* first_hr) {
report_region_type_change(G1HeapRegionTraceType::ContinuesHumongous);
_type.set_continues_humongous();
_humongous_start_region = first_hr;

_bot_part.set_object_can_span(true);
}

void HeapRegion::clear_humongous() {
assert(is_humongous(), "pre-condition");

assert(capacity() == HeapRegion::GrainBytes, "pre-condition");
_humongous_start_region = NULL;

_bot_part.set_object_can_span(false);
}

HeapRegion::HeapRegion(uint hrm_index,

1 comment on commit 44fcee3

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 44fcee3 Dec 7, 2021

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.