mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-25 17:50:45 +00:00
8058495: G1: normalize names for isHumongous() and friends
Reviewed-by: tschatzl, brutisso
This commit is contained in:
parent
fada700e21
commit
da5afa76ab
@ -107,7 +107,7 @@ void CollectionSetChooser::verify() {
|
||||
HeapRegion *curr = regions_at(index++);
|
||||
guarantee(curr != NULL, "Regions in _regions array cannot be NULL");
|
||||
guarantee(!curr->is_young(), "should not be young!");
|
||||
guarantee(!curr->isHumongous(), "should not be humongous!");
|
||||
guarantee(!curr->is_humongous(), "should not be humongous!");
|
||||
if (prev != NULL) {
|
||||
guarantee(order_regions(prev, curr) != 1,
|
||||
err_msg("GC eff prev: %1.4f GC eff curr: %1.4f",
|
||||
@ -149,7 +149,7 @@ void CollectionSetChooser::sort_regions() {
|
||||
|
||||
|
||||
void CollectionSetChooser::add_region(HeapRegion* hr) {
|
||||
assert(!hr->isHumongous(),
|
||||
assert(!hr->is_humongous(),
|
||||
"Humongous regions shouldn't be added to the collection set");
|
||||
assert(!hr->is_young(), "should not be young!");
|
||||
_regions.append(hr);
|
||||
|
||||
@ -109,7 +109,7 @@ public:
|
||||
bool should_add(HeapRegion* hr) {
|
||||
assert(hr->is_marked(), "pre-condition");
|
||||
assert(!hr->is_young(), "should never consider young regions");
|
||||
return !hr->isHumongous() &&
|
||||
return !hr->is_humongous() &&
|
||||
hr->live_bytes() < _region_live_threshold_bytes;
|
||||
}
|
||||
|
||||
|
||||
@ -910,7 +910,7 @@ bool ConcurrentMark::nextMarkBitmapIsClear() {
|
||||
class NoteStartOfMarkHRClosure: public HeapRegionClosure {
|
||||
public:
|
||||
bool doHeapRegion(HeapRegion* r) {
|
||||
if (!r->continuesHumongous()) {
|
||||
if (!r->is_continues_humongous()) {
|
||||
r->note_start_of_marking();
|
||||
}
|
||||
return false;
|
||||
@ -1398,10 +1398,10 @@ protected:
|
||||
// to 1 the bits on the region bitmap that correspond to its
|
||||
// associated "continues humongous" regions.
|
||||
void set_bit_for_region(HeapRegion* hr) {
|
||||
assert(!hr->continuesHumongous(), "should have filtered those out");
|
||||
assert(!hr->is_continues_humongous(), "should have filtered those out");
|
||||
|
||||
BitMap::idx_t index = (BitMap::idx_t) hr->hrm_index();
|
||||
if (!hr->startsHumongous()) {
|
||||
if (!hr->is_starts_humongous()) {
|
||||
// Normal (non-humongous) case: just set the bit.
|
||||
_region_bm->par_at_put(index, true);
|
||||
} else {
|
||||
@ -1434,7 +1434,7 @@ public:
|
||||
|
||||
bool doHeapRegion(HeapRegion* hr) {
|
||||
|
||||
if (hr->continuesHumongous()) {
|
||||
if (hr->is_continues_humongous()) {
|
||||
// We will ignore these here and process them when their
|
||||
// associated "starts humongous" region is processed (see
|
||||
// set_bit_for_heap_region()). Note that we cannot rely on their
|
||||
@ -1556,7 +1556,7 @@ public:
|
||||
int failures() const { return _failures; }
|
||||
|
||||
bool doHeapRegion(HeapRegion* hr) {
|
||||
if (hr->continuesHumongous()) {
|
||||
if (hr->is_continues_humongous()) {
|
||||
// We will ignore these here and process them when their
|
||||
// associated "starts humongous" region is processed (see
|
||||
// set_bit_for_heap_region()). Note that we cannot rely on their
|
||||
@ -1731,7 +1731,7 @@ class FinalCountDataUpdateClosure: public CMCountDataClosureBase {
|
||||
|
||||
bool doHeapRegion(HeapRegion* hr) {
|
||||
|
||||
if (hr->continuesHumongous()) {
|
||||
if (hr->is_continues_humongous()) {
|
||||
// We will ignore these here and process them when their
|
||||
// associated "starts humongous" region is processed (see
|
||||
// set_bit_for_heap_region()). Note that we cannot rely on their
|
||||
@ -1861,7 +1861,7 @@ public:
|
||||
const HeapRegionSetCount& humongous_regions_removed() { return _humongous_regions_removed; }
|
||||
|
||||
bool doHeapRegion(HeapRegion *hr) {
|
||||
if (hr->continuesHumongous()) {
|
||||
if (hr->is_continues_humongous()) {
|
||||
return false;
|
||||
}
|
||||
// We use a claim value of zero here because all regions
|
||||
@ -1875,8 +1875,8 @@ public:
|
||||
if (hr->used() > 0 && hr->max_live_bytes() == 0 && !hr->is_young()) {
|
||||
_freed_bytes += hr->used();
|
||||
hr->set_containing_set(NULL);
|
||||
if (hr->isHumongous()) {
|
||||
assert(hr->startsHumongous(), "we should only see starts humongous");
|
||||
if (hr->is_humongous()) {
|
||||
assert(hr->is_starts_humongous(), "we should only see starts humongous");
|
||||
_humongous_regions_removed.increment(1u, hr->capacity());
|
||||
_g1->free_humongous_region(hr, _local_cleanup_list, true);
|
||||
} else {
|
||||
@ -3191,7 +3191,7 @@ class AggregateCountDataHRClosure: public HeapRegionClosure {
|
||||
_cm_card_bm(cm_card_bm), _max_worker_id(max_worker_id) { }
|
||||
|
||||
bool doHeapRegion(HeapRegion* hr) {
|
||||
if (hr->continuesHumongous()) {
|
||||
if (hr->is_continues_humongous()) {
|
||||
// We will ignore these here and process them when their
|
||||
// associated "starts humongous" region is processed.
|
||||
// Note that we cannot rely on their associated
|
||||
@ -3563,7 +3563,7 @@ G1CMOopClosure::G1CMOopClosure(G1CollectedHeap* g1h,
|
||||
void CMTask::setup_for_region(HeapRegion* hr) {
|
||||
assert(hr != NULL,
|
||||
"claim_region() should have filtered out NULL regions");
|
||||
assert(!hr->continuesHumongous(),
|
||||
assert(!hr->is_continues_humongous(),
|
||||
"claim_region() should have filtered out continues humongous regions");
|
||||
|
||||
if (_cm->verbose_low()) {
|
||||
@ -4288,7 +4288,7 @@ void CMTask::do_marking_step(double time_target_ms,
|
||||
HR_FORMAT_PARAMS(_curr_region));
|
||||
}
|
||||
|
||||
assert(!_curr_region->isHumongous() || mr.start() == _curr_region->bottom(),
|
||||
assert(!_curr_region->is_humongous() || mr.start() == _curr_region->bottom(),
|
||||
"humongous regions should go around loop once only");
|
||||
|
||||
// Some special cases:
|
||||
@ -4302,7 +4302,7 @@ void CMTask::do_marking_step(double time_target_ms,
|
||||
if (mr.is_empty()) {
|
||||
giveup_current_region();
|
||||
regular_clock_call();
|
||||
} else if (_curr_region->isHumongous() && mr.start() == _curr_region->bottom()) {
|
||||
} else if (_curr_region->is_humongous() && mr.start() == _curr_region->bottom()) {
|
||||
if (_nextMarkBitMap->isMarked(mr.start())) {
|
||||
// The object is marked - apply the closure
|
||||
BitMap::idx_t offset = _nextMarkBitMap->heapWordToOffset(mr.start());
|
||||
@ -4749,7 +4749,7 @@ bool G1PrintRegionLivenessInfoClosure::doHeapRegion(HeapRegion* r) {
|
||||
size_t remset_bytes = r->rem_set()->mem_size();
|
||||
size_t strong_code_roots_bytes = r->rem_set()->strong_code_roots_mem_size();
|
||||
|
||||
if (r->startsHumongous()) {
|
||||
if (r->is_starts_humongous()) {
|
||||
assert(_hum_used_bytes == 0 && _hum_capacity_bytes == 0 &&
|
||||
_hum_prev_live_bytes == 0 && _hum_next_live_bytes == 0,
|
||||
"they should have been zeroed after the last time we used them");
|
||||
@ -4761,7 +4761,7 @@ bool G1PrintRegionLivenessInfoClosure::doHeapRegion(HeapRegion* r) {
|
||||
get_hum_bytes(&used_bytes, &capacity_bytes,
|
||||
&prev_live_bytes, &next_live_bytes);
|
||||
end = bottom + HeapRegion::GrainWords;
|
||||
} else if (r->continuesHumongous()) {
|
||||
} else if (r->is_continues_humongous()) {
|
||||
get_hum_bytes(&used_bytes, &capacity_bytes,
|
||||
&prev_live_bytes, &next_live_bytes);
|
||||
assert(end == bottom + HeapRegion::GrainWords, "invariant");
|
||||
|
||||
@ -88,7 +88,7 @@ inline void ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr,
|
||||
size_t region_size_bytes = mr.byte_size();
|
||||
uint index = hr->hrm_index();
|
||||
|
||||
assert(!hr->continuesHumongous(), "should not be HC region");
|
||||
assert(!hr->is_continues_humongous(), "should not be HC region");
|
||||
assert(hr == g1h->heap_region_containing(start), "sanity");
|
||||
assert(hr == g1h->heap_region_containing(mr.last()), "sanity");
|
||||
assert(marked_bytes_array != NULL, "pre-condition");
|
||||
@ -366,7 +366,7 @@ inline void ConcurrentMark::grayRoot(oop obj, size_t word_size,
|
||||
assert(hr != NULL, "sanity");
|
||||
// Given that we're looking for a region that contains an object
|
||||
// header it's impossible to get back a HC region.
|
||||
assert(!hr->continuesHumongous(), "sanity");
|
||||
assert(!hr->is_continues_humongous(), "sanity");
|
||||
|
||||
// We cannot assert that word_size == obj->size() given that obj
|
||||
// might not be in a consistent state (another thread might be in
|
||||
|
||||
@ -58,7 +58,7 @@ void G1Allocator::reuse_retained_old_region(EvacuationInfo& evacuation_info,
|
||||
!retained_region->in_collection_set() &&
|
||||
!(retained_region->top() == retained_region->end()) &&
|
||||
!retained_region->is_empty() &&
|
||||
!retained_region->isHumongous()) {
|
||||
!retained_region->is_humongous()) {
|
||||
retained_region->record_top_and_timestamp();
|
||||
// The retained region was added to the old region set when it was
|
||||
// retired. We have to remove it now, since we don't allow regions
|
||||
|
||||
@ -469,7 +469,7 @@ bool G1CollectedHeap::is_in_partial_collection(const void* p) {
|
||||
// can move in an incremental collection.
|
||||
bool G1CollectedHeap::is_scavengable(const void* p) {
|
||||
HeapRegion* hr = heap_region_containing(p);
|
||||
return !hr->isHumongous();
|
||||
return !hr->is_humongous();
|
||||
}
|
||||
|
||||
void G1CollectedHeap::check_ct_logs_at_safepoint() {
|
||||
@ -560,7 +560,7 @@ G1CollectedHeap::new_region_try_secondary_free_list(bool is_old) {
|
||||
}
|
||||
|
||||
HeapRegion* G1CollectedHeap::new_region(size_t word_size, bool is_old, bool do_expand) {
|
||||
assert(!isHumongous(word_size) || word_size <= HeapRegion::GrainWords,
|
||||
assert(!is_humongous(word_size) || word_size <= HeapRegion::GrainWords,
|
||||
"the only time we use this to allocate a humongous region is "
|
||||
"when we are allocating a single humongous region");
|
||||
|
||||
@ -618,7 +618,7 @@ G1CollectedHeap::humongous_obj_allocate_initialize_regions(uint first,
|
||||
size_t word_size,
|
||||
AllocationContext_t context) {
|
||||
assert(first != G1_NO_HRM_INDEX, "pre-condition");
|
||||
assert(isHumongous(word_size), "word_size should be humongous");
|
||||
assert(is_humongous(word_size), "word_size should be humongous");
|
||||
assert(num_regions * HeapRegion::GrainWords >= word_size, "pre-condition");
|
||||
|
||||
// Index of last region in the series + 1.
|
||||
@ -667,14 +667,14 @@ G1CollectedHeap::humongous_obj_allocate_initialize_regions(uint first,
|
||||
// will also update the BOT covering all the regions to reflect
|
||||
// that there is a single object that starts at the bottom of the
|
||||
// first region.
|
||||
first_hr->set_startsHumongous(new_top, new_end);
|
||||
first_hr->set_starts_humongous(new_top, new_end);
|
||||
first_hr->set_allocation_context(context);
|
||||
// Then, if there are any, we will set up the "continues
|
||||
// humongous" regions.
|
||||
HeapRegion* hr = NULL;
|
||||
for (uint i = first + 1; i < last; ++i) {
|
||||
hr = region_at(i);
|
||||
hr->set_continuesHumongous(first_hr);
|
||||
hr->set_continues_humongous(first_hr);
|
||||
hr->set_allocation_context(context);
|
||||
}
|
||||
// If we have "continues humongous" regions (hr != NULL), then the
|
||||
@ -713,7 +713,7 @@ G1CollectedHeap::humongous_obj_allocate_initialize_regions(uint first,
|
||||
// G1. For example, the code that looks for a consecutive number
|
||||
// of empty regions will consider them empty and try to
|
||||
// re-allocate them. We can extend is_empty() to also include
|
||||
// !continuesHumongous(), but it is easier to just update the top
|
||||
// !is_continues_humongous(), but it is easier to just update the top
|
||||
// fields here. The way we set top for all regions (i.e., top ==
|
||||
// end for all regions but the last one, top == new_top for the
|
||||
// last one) is actually used when we will free up the humongous
|
||||
@ -837,7 +837,7 @@ HeapWord* G1CollectedHeap::humongous_obj_allocate(size_t word_size, AllocationCo
|
||||
|
||||
HeapWord* G1CollectedHeap::allocate_new_tlab(size_t word_size) {
|
||||
assert_heap_not_locked_and_not_at_safepoint();
|
||||
assert(!isHumongous(word_size), "we do not allow humongous TLABs");
|
||||
assert(!is_humongous(word_size), "we do not allow humongous TLABs");
|
||||
|
||||
unsigned int dummy_gc_count_before;
|
||||
int dummy_gclocker_retry_count = 0;
|
||||
@ -854,7 +854,7 @@ G1CollectedHeap::mem_allocate(size_t word_size,
|
||||
unsigned int gc_count_before;
|
||||
|
||||
HeapWord* result = NULL;
|
||||
if (!isHumongous(word_size)) {
|
||||
if (!is_humongous(word_size)) {
|
||||
result = attempt_allocation(word_size, &gc_count_before, &gclocker_retry_count);
|
||||
} else {
|
||||
result = attempt_allocation_humongous(word_size, &gc_count_before, &gclocker_retry_count);
|
||||
@ -875,7 +875,7 @@ G1CollectedHeap::mem_allocate(size_t word_size,
|
||||
// if it is NULL. If the allocation attempt failed immediately
|
||||
// after a Full GC, it's unlikely we'll be able to allocate now.
|
||||
HeapWord* result = op.result();
|
||||
if (result != NULL && !isHumongous(word_size)) {
|
||||
if (result != NULL && !is_humongous(word_size)) {
|
||||
// Allocations that take place on VM operations do not do any
|
||||
// card dirtying and we have to do it here. We only have to do
|
||||
// this for non-humongous allocations, though.
|
||||
@ -908,7 +908,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size,
|
||||
// Make sure you read the note in attempt_allocation_humongous().
|
||||
|
||||
assert_heap_not_locked_and_not_at_safepoint();
|
||||
assert(!isHumongous(word_size), "attempt_allocation_slow() should not "
|
||||
assert(!is_humongous(word_size), "attempt_allocation_slow() should not "
|
||||
"be called for humongous allocation requests");
|
||||
|
||||
// We should only get here after the first-level allocation attempt
|
||||
@ -1033,7 +1033,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size,
|
||||
// much as possible.
|
||||
|
||||
assert_heap_not_locked_and_not_at_safepoint();
|
||||
assert(isHumongous(word_size), "attempt_allocation_humongous() "
|
||||
assert(is_humongous(word_size), "attempt_allocation_humongous() "
|
||||
"should only be called for humongous allocations");
|
||||
|
||||
// Humongous objects can exhaust the heap quickly, so we should check if we
|
||||
@ -1144,7 +1144,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_at_safepoint(size_t word_size,
|
||||
!expect_null_mutator_alloc_region,
|
||||
"the current alloc region was unexpectedly found to be non-NULL");
|
||||
|
||||
if (!isHumongous(word_size)) {
|
||||
if (!is_humongous(word_size)) {
|
||||
return _allocator->mutator_alloc_region(context)->attempt_allocation_locked(word_size,
|
||||
false /* bot_updates */);
|
||||
} else {
|
||||
@ -1168,7 +1168,7 @@ public:
|
||||
bool doHeapRegion(HeapRegion* r) {
|
||||
HeapRegionRemSet* hrrs = r->rem_set();
|
||||
|
||||
if (r->continuesHumongous()) {
|
||||
if (r->is_continues_humongous()) {
|
||||
// We'll assert that the strong code root list and RSet is empty
|
||||
assert(hrrs->strong_code_roots_list_length() == 0, "sanity");
|
||||
assert(hrrs->occupied() == 0, "RSet should be empty");
|
||||
@ -1205,7 +1205,7 @@ public:
|
||||
{ }
|
||||
|
||||
bool doHeapRegion(HeapRegion* r) {
|
||||
if (!r->continuesHumongous()) {
|
||||
if (!r->is_continues_humongous()) {
|
||||
_cl.set_from(r);
|
||||
r->oop_iterate(&_cl);
|
||||
}
|
||||
@ -1237,14 +1237,14 @@ public:
|
||||
assert(!hr->is_young(), "not expecting to find young regions");
|
||||
if (hr->is_free()) {
|
||||
// We only generate output for non-empty regions.
|
||||
} else if (hr->startsHumongous()) {
|
||||
} else if (hr->is_starts_humongous()) {
|
||||
if (hr->region_num() == 1) {
|
||||
// single humongous region
|
||||
_hr_printer->post_compaction(hr, G1HRPrinter::SingleHumongous);
|
||||
} else {
|
||||
_hr_printer->post_compaction(hr, G1HRPrinter::StartsHumongous);
|
||||
}
|
||||
} else if (hr->continuesHumongous()) {
|
||||
} else if (hr->is_continues_humongous()) {
|
||||
_hr_printer->post_compaction(hr, G1HRPrinter::ContinuesHumongous);
|
||||
} else if (hr->is_old()) {
|
||||
_hr_printer->post_compaction(hr, G1HRPrinter::Old);
|
||||
@ -2243,14 +2243,14 @@ size_t G1CollectedHeap::capacity() const {
|
||||
}
|
||||
|
||||
void G1CollectedHeap::reset_gc_time_stamps(HeapRegion* hr) {
|
||||
assert(!hr->continuesHumongous(), "pre-condition");
|
||||
assert(!hr->is_continues_humongous(), "pre-condition");
|
||||
hr->reset_gc_time_stamp();
|
||||
if (hr->startsHumongous()) {
|
||||
if (hr->is_starts_humongous()) {
|
||||
uint first_index = hr->hrm_index() + 1;
|
||||
uint last_index = hr->last_hc_index();
|
||||
for (uint i = first_index; i < last_index; i += 1) {
|
||||
HeapRegion* chr = region_at(i);
|
||||
assert(chr->continuesHumongous(), "sanity");
|
||||
assert(chr->is_continues_humongous(), "sanity");
|
||||
chr->reset_gc_time_stamp();
|
||||
}
|
||||
}
|
||||
@ -2320,7 +2320,7 @@ class SumUsedClosure: public HeapRegionClosure {
|
||||
public:
|
||||
SumUsedClosure() : _used(0) {}
|
||||
bool doHeapRegion(HeapRegion* r) {
|
||||
if (!r->continuesHumongous()) {
|
||||
if (!r->is_continues_humongous()) {
|
||||
_used += r->used();
|
||||
}
|
||||
return false;
|
||||
@ -2352,7 +2352,7 @@ void G1CollectedHeap::allocate_dummy_regions() {
|
||||
// Let's fill up most of the region
|
||||
size_t word_size = HeapRegion::GrainWords - 1024;
|
||||
// And as a result the region we'll allocate will be humongous.
|
||||
guarantee(isHumongous(word_size), "sanity");
|
||||
guarantee(is_humongous(word_size), "sanity");
|
||||
|
||||
for (uintx i = 0; i < G1DummyRegionsPerGC; ++i) {
|
||||
// Let's use the existing mechanism for the allocation
|
||||
@ -2580,7 +2580,7 @@ class IterateOopClosureRegionClosure: public HeapRegionClosure {
|
||||
public:
|
||||
IterateOopClosureRegionClosure(ExtendedOopClosure* cl) : _cl(cl) {}
|
||||
bool doHeapRegion(HeapRegion* r) {
|
||||
if (!r->continuesHumongous()) {
|
||||
if (!r->is_continues_humongous()) {
|
||||
r->oop_iterate(_cl);
|
||||
}
|
||||
return false;
|
||||
@ -2599,7 +2599,7 @@ class IterateObjectClosureRegionClosure: public HeapRegionClosure {
|
||||
public:
|
||||
IterateObjectClosureRegionClosure(ObjectClosure* cl) : _cl(cl) {}
|
||||
bool doHeapRegion(HeapRegion* r) {
|
||||
if (! r->continuesHumongous()) {
|
||||
if (!r->is_continues_humongous()) {
|
||||
r->object_iterate(_cl);
|
||||
}
|
||||
return false;
|
||||
@ -2681,11 +2681,11 @@ public:
|
||||
r->claim_value(), _claim_value);
|
||||
++_failures;
|
||||
}
|
||||
if (!r->isHumongous()) {
|
||||
if (!r->is_humongous()) {
|
||||
_sh_region = NULL;
|
||||
} else if (r->startsHumongous()) {
|
||||
} else if (r->is_starts_humongous()) {
|
||||
_sh_region = r;
|
||||
} else if (r->continuesHumongous()) {
|
||||
} else if (r->is_continues_humongous()) {
|
||||
if (r->humongous_start_region() != _sh_region) {
|
||||
gclog_or_tty->print_cr("Region " HR_FORMAT ", "
|
||||
"HS = "PTR_FORMAT", should be "PTR_FORMAT,
|
||||
@ -2719,7 +2719,7 @@ public:
|
||||
|
||||
bool doHeapRegion(HeapRegion* hr) {
|
||||
assert(hr->in_collection_set(), "how?");
|
||||
assert(!hr->isHumongous(), "H-region in CSet");
|
||||
assert(!hr->is_humongous(), "H-region in CSet");
|
||||
if (hr->claim_value() != _claim_value) {
|
||||
gclog_or_tty->print_cr("CSet Region " HR_FORMAT ", "
|
||||
"claim value = %d, should be %d",
|
||||
@ -2858,7 +2858,7 @@ void G1CollectedHeap::collection_set_iterate_from(HeapRegion* r,
|
||||
|
||||
HeapRegion* G1CollectedHeap::next_compaction_region(const HeapRegion* from) const {
|
||||
HeapRegion* result = _hrm.next_region_in_heap(from);
|
||||
while (result != NULL && result->isHumongous()) {
|
||||
while (result != NULL && result->is_humongous()) {
|
||||
result = _hrm.next_region_in_heap(result);
|
||||
}
|
||||
return result;
|
||||
@ -3218,7 +3218,7 @@ public:
|
||||
}
|
||||
|
||||
bool doHeapRegion(HeapRegion* r) {
|
||||
if (!r->continuesHumongous()) {
|
||||
if (!r->is_continues_humongous()) {
|
||||
bool failures = false;
|
||||
r->verify(_vo, &failures);
|
||||
if (failures) {
|
||||
@ -3678,7 +3678,7 @@ size_t G1CollectedHeap::cards_scanned() {
|
||||
|
||||
bool G1CollectedHeap::humongous_region_is_always_live(uint index) {
|
||||
HeapRegion* region = region_at(index);
|
||||
assert(region->startsHumongous(), "Must start a humongous object");
|
||||
assert(region->is_starts_humongous(), "Must start a humongous object");
|
||||
return oop(region->bottom())->is_objArray() || !region->rem_set()->is_empty();
|
||||
}
|
||||
|
||||
@ -3691,7 +3691,7 @@ class RegisterHumongousWithInCSetFastTestClosure : public HeapRegionClosure {
|
||||
}
|
||||
|
||||
virtual bool doHeapRegion(HeapRegion* r) {
|
||||
if (!r->startsHumongous()) {
|
||||
if (!r->is_starts_humongous()) {
|
||||
return false;
|
||||
}
|
||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||
@ -6001,7 +6001,7 @@ void G1CollectedHeap::free_region(HeapRegion* hr,
|
||||
void G1CollectedHeap::free_humongous_region(HeapRegion* hr,
|
||||
FreeRegionList* free_list,
|
||||
bool par) {
|
||||
assert(hr->startsHumongous(), "this is only for starts humongous regions");
|
||||
assert(hr->is_starts_humongous(), "this is only for starts humongous regions");
|
||||
assert(free_list != NULL, "pre-condition");
|
||||
|
||||
size_t hr_capacity = hr->capacity();
|
||||
@ -6014,7 +6014,7 @@ void G1CollectedHeap::free_humongous_region(HeapRegion* hr,
|
||||
uint i = hr->hrm_index() + 1;
|
||||
while (i < last_index) {
|
||||
HeapRegion* curr_hr = region_at(i);
|
||||
assert(curr_hr->continuesHumongous(), "invariant");
|
||||
assert(curr_hr->is_continues_humongous(), "invariant");
|
||||
curr_hr->clear_humongous();
|
||||
free_region(curr_hr, free_list, par);
|
||||
i += 1;
|
||||
@ -6182,7 +6182,7 @@ public:
|
||||
bool failures() { return _failures; }
|
||||
|
||||
virtual bool doHeapRegion(HeapRegion* hr) {
|
||||
if (hr->continuesHumongous()) return false;
|
||||
if (hr->is_continues_humongous()) return false;
|
||||
|
||||
bool result = _g1h->verify_bitmaps(_caller, hr);
|
||||
if (!result) {
|
||||
@ -6361,7 +6361,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure {
|
||||
}
|
||||
|
||||
virtual bool doHeapRegion(HeapRegion* r) {
|
||||
if (!r->startsHumongous()) {
|
||||
if (!r->is_starts_humongous()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -6407,7 +6407,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure {
|
||||
|
||||
if (G1TraceReclaimDeadHumongousObjectsAtYoungGC) {
|
||||
gclog_or_tty->print_cr("Live humongous %d region %d with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d live-other %d obj array %d",
|
||||
r->isHumongous(),
|
||||
r->is_humongous(),
|
||||
region_idx,
|
||||
r->rem_set()->occupied(),
|
||||
r->rem_set()->strong_code_roots_list_length(),
|
||||
@ -6426,7 +6426,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure {
|
||||
|
||||
if (G1TraceReclaimDeadHumongousObjectsAtYoungGC) {
|
||||
gclog_or_tty->print_cr("Reclaim humongous region %d start "PTR_FORMAT" region %d length "UINT32_FORMAT" with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d live-other %d obj array %d",
|
||||
r->isHumongous(),
|
||||
r->is_humongous(),
|
||||
r->bottom(),
|
||||
region_idx,
|
||||
r->region_num(),
|
||||
@ -6616,7 +6616,7 @@ public:
|
||||
// We ignore young regions, we'll empty the young list afterwards.
|
||||
// We ignore humongous regions, we're not tearing down the
|
||||
// humongous regions set.
|
||||
assert(r->is_free() || r->is_young() || r->isHumongous(),
|
||||
assert(r->is_free() || r->is_young() || r->is_humongous(),
|
||||
"it cannot be another type");
|
||||
}
|
||||
return false;
|
||||
@ -6661,7 +6661,7 @@ public:
|
||||
}
|
||||
|
||||
bool doHeapRegion(HeapRegion* r) {
|
||||
if (r->continuesHumongous()) {
|
||||
if (r->is_continues_humongous()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -6673,7 +6673,7 @@ public:
|
||||
} else if (!_free_list_only) {
|
||||
assert(!r->is_young(), "we should not come across young regions");
|
||||
|
||||
if (r->isHumongous()) {
|
||||
if (r->is_humongous()) {
|
||||
// We ignore humongous regions, we left the humongous set unchanged
|
||||
} else {
|
||||
// Objects that were compacted would have ended up on regions
|
||||
@ -6844,13 +6844,13 @@ public:
|
||||
_old_count(), _humongous_count(), _free_count(){ }
|
||||
|
||||
bool doHeapRegion(HeapRegion* hr) {
|
||||
if (hr->continuesHumongous()) {
|
||||
if (hr->is_continues_humongous()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hr->is_young()) {
|
||||
// TODO
|
||||
} else if (hr->startsHumongous()) {
|
||||
} else if (hr->is_starts_humongous()) {
|
||||
assert(hr->containing_set() == _humongous_set, err_msg("Heap region %u is starts humongous but not in humongous set.", hr->hrm_index()));
|
||||
_humongous_count.increment(1u, hr->capacity());
|
||||
} else if (hr->is_empty()) {
|
||||
@ -6931,7 +6931,7 @@ class RegisterNMethodOopClosure: public OopClosure {
|
||||
if (!oopDesc::is_null(heap_oop)) {
|
||||
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
|
||||
HeapRegion* hr = _g1h->heap_region_containing(obj);
|
||||
assert(!hr->continuesHumongous(),
|
||||
assert(!hr->is_continues_humongous(),
|
||||
err_msg("trying to add code root "PTR_FORMAT" in continuation of humongous region "HR_FORMAT
|
||||
" starting at "HR_FORMAT,
|
||||
_nm, HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region())));
|
||||
@ -6958,7 +6958,7 @@ class UnregisterNMethodOopClosure: public OopClosure {
|
||||
if (!oopDesc::is_null(heap_oop)) {
|
||||
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
|
||||
HeapRegion* hr = _g1h->heap_region_containing(obj);
|
||||
assert(!hr->continuesHumongous(),
|
||||
assert(!hr->is_continues_humongous(),
|
||||
err_msg("trying to remove code root "PTR_FORMAT" in continuation of humongous region "HR_FORMAT
|
||||
" starting at "HR_FORMAT,
|
||||
_nm, HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region())));
|
||||
|
||||
@ -1512,7 +1512,7 @@ public:
|
||||
virtual inline bool can_elide_initializing_store_barrier(oop new_obj);
|
||||
|
||||
// Returns "true" iff the given word_size is "very large".
|
||||
static bool isHumongous(size_t word_size) {
|
||||
static bool is_humongous(size_t word_size) {
|
||||
// Note this has to be strictly greater-than as the TLABs
|
||||
// are capped at the humongous threshold and we want to
|
||||
// ensure that we don't try to allocate a TLAB as
|
||||
|
||||
@ -67,7 +67,7 @@ inline HeapRegion* G1CollectedHeap::heap_region_containing_raw(const T addr) con
|
||||
template <class T>
|
||||
inline HeapRegion* G1CollectedHeap::heap_region_containing(const T addr) const {
|
||||
HeapRegion* hr = heap_region_containing_raw(addr);
|
||||
if (hr->continuesHumongous()) {
|
||||
if (hr->is_continues_humongous()) {
|
||||
return hr->humongous_start_region();
|
||||
}
|
||||
return hr;
|
||||
@ -99,7 +99,7 @@ inline HeapWord* G1CollectedHeap::attempt_allocation(size_t word_size,
|
||||
unsigned int* gc_count_before_ret,
|
||||
int* gclocker_retry_count_ret) {
|
||||
assert_heap_not_locked_and_not_at_safepoint();
|
||||
assert(!isHumongous(word_size), "attempt_allocation() should not "
|
||||
assert(!is_humongous(word_size), "attempt_allocation() should not "
|
||||
"be called for humongous allocation requests");
|
||||
|
||||
AllocationContext_t context = AllocationContext::current();
|
||||
@ -120,7 +120,7 @@ inline HeapWord* G1CollectedHeap::attempt_allocation(size_t word_size,
|
||||
|
||||
inline HeapWord* G1CollectedHeap::survivor_attempt_allocation(size_t word_size,
|
||||
AllocationContext_t context) {
|
||||
assert(!isHumongous(word_size),
|
||||
assert(!is_humongous(word_size),
|
||||
"we should not be seeing humongous-size allocations in this path");
|
||||
|
||||
HeapWord* result = _allocator->survivor_gc_alloc_region(context)->attempt_allocation(word_size,
|
||||
@ -138,7 +138,7 @@ inline HeapWord* G1CollectedHeap::survivor_attempt_allocation(size_t word_size,
|
||||
|
||||
inline HeapWord* G1CollectedHeap::old_attempt_allocation(size_t word_size,
|
||||
AllocationContext_t context) {
|
||||
assert(!isHumongous(word_size),
|
||||
assert(!is_humongous(word_size),
|
||||
"we should not be seeing humongous-size allocations in this path");
|
||||
|
||||
HeapWord* result = _allocator->old_gc_alloc_region(context)->attempt_allocation(word_size,
|
||||
@ -166,7 +166,7 @@ G1CollectedHeap::dirty_young_block(HeapWord* start, size_t word_size) {
|
||||
assert(word_size > 0, "pre-condition");
|
||||
assert(containing_hr->is_in(start), "it should contain start");
|
||||
assert(containing_hr->is_young(), "it should be young");
|
||||
assert(!containing_hr->isHumongous(), "it should not be humongous");
|
||||
assert(!containing_hr->is_humongous(), "it should not be humongous");
|
||||
|
||||
HeapWord* end = start + word_size;
|
||||
assert(containing_hr->is_in(end - 1), "it should also contain end - 1");
|
||||
|
||||
@ -192,7 +192,7 @@ public:
|
||||
bool during_initial_mark = _g1h->g1_policy()->during_initial_mark_pause();
|
||||
bool during_conc_mark = _g1h->mark_in_progress();
|
||||
|
||||
assert(!hr->isHumongous(), "sanity");
|
||||
assert(!hr->is_humongous(), "sanity");
|
||||
assert(hr->in_collection_set(), "bad CS");
|
||||
|
||||
if (hr->claimHeapRegion(HeapRegion::ParEvacFailureClaimValue)) {
|
||||
|
||||
@ -210,8 +210,8 @@ void G1MarkSweep::mark_sweep_phase2() {
|
||||
class G1AdjustPointersClosure: public HeapRegionClosure {
|
||||
public:
|
||||
bool doHeapRegion(HeapRegion* r) {
|
||||
if (r->isHumongous()) {
|
||||
if (r->startsHumongous()) {
|
||||
if (r->is_humongous()) {
|
||||
if (r->is_starts_humongous()) {
|
||||
// We must adjust the pointers on the single H object.
|
||||
oop obj = oop(r->bottom());
|
||||
// point all the oops to the new location
|
||||
@ -266,8 +266,8 @@ public:
|
||||
G1SpaceCompactClosure() {}
|
||||
|
||||
bool doHeapRegion(HeapRegion* hr) {
|
||||
if (hr->isHumongous()) {
|
||||
if (hr->startsHumongous()) {
|
||||
if (hr->is_humongous()) {
|
||||
if (hr->is_starts_humongous()) {
|
||||
oop obj = oop(hr->bottom());
|
||||
if (obj->is_gc_marked()) {
|
||||
obj->init_mark();
|
||||
@ -310,7 +310,7 @@ void G1PrepareCompactClosure::free_humongous_region(HeapRegion* hr) {
|
||||
HeapWord* end = hr->end();
|
||||
FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep");
|
||||
|
||||
assert(hr->startsHumongous(),
|
||||
assert(hr->is_starts_humongous(),
|
||||
"Only the start of a humongous region should be freed.");
|
||||
|
||||
hr->set_containing_set(NULL);
|
||||
@ -348,8 +348,8 @@ void G1PrepareCompactClosure::update_sets() {
|
||||
}
|
||||
|
||||
bool G1PrepareCompactClosure::doHeapRegion(HeapRegion* hr) {
|
||||
if (hr->isHumongous()) {
|
||||
if (hr->startsHumongous()) {
|
||||
if (hr->is_humongous()) {
|
||||
if (hr->is_starts_humongous()) {
|
||||
oop obj = oop(hr->bottom());
|
||||
if (obj->is_gc_marked()) {
|
||||
obj->forward_to(obj);
|
||||
@ -357,7 +357,7 @@ bool G1PrepareCompactClosure::doHeapRegion(HeapRegion* hr) {
|
||||
free_humongous_region(hr);
|
||||
}
|
||||
} else {
|
||||
assert(hr->continuesHumongous(), "Invalid humongous.");
|
||||
assert(hr->is_continues_humongous(), "Invalid humongous.");
|
||||
}
|
||||
} else {
|
||||
prepare_for_compaction(hr, hr->end());
|
||||
|
||||
@ -413,7 +413,7 @@ public:
|
||||
_ctbs(_g1h->g1_barrier_set()) {}
|
||||
|
||||
bool doHeapRegion(HeapRegion* r) {
|
||||
if (!r->continuesHumongous()) {
|
||||
if (!r->is_continues_humongous()) {
|
||||
r->rem_set()->scrub(_ctbs, _region_bm, _card_bm);
|
||||
}
|
||||
return false;
|
||||
|
||||
@ -263,7 +263,7 @@ public:
|
||||
current = &_free;
|
||||
} else if (r->is_young()) {
|
||||
current = &_young;
|
||||
} else if (r->isHumongous()) {
|
||||
} else if (r->is_humongous()) {
|
||||
current = &_humonguous;
|
||||
} else if (r->is_old()) {
|
||||
current = &_old;
|
||||
|
||||
@ -250,8 +250,8 @@ void HeapRegion::calc_gc_efficiency() {
|
||||
_gc_efficiency = (double) reclaimable_bytes() / region_elapsed_time_ms;
|
||||
}
|
||||
|
||||
void HeapRegion::set_startsHumongous(HeapWord* new_top, HeapWord* new_end) {
|
||||
assert(!isHumongous(), "sanity / pre-condition");
|
||||
void HeapRegion::set_starts_humongous(HeapWord* new_top, HeapWord* new_end) {
|
||||
assert(!is_humongous(), "sanity / pre-condition");
|
||||
assert(end() == orig_end(),
|
||||
"Should be normal before the humongous object allocation");
|
||||
assert(top() == bottom(), "should be empty");
|
||||
@ -264,21 +264,21 @@ void HeapRegion::set_startsHumongous(HeapWord* new_top, HeapWord* new_end) {
|
||||
_offsets.set_for_starts_humongous(new_top);
|
||||
}
|
||||
|
||||
void HeapRegion::set_continuesHumongous(HeapRegion* first_hr) {
|
||||
assert(!isHumongous(), "sanity / pre-condition");
|
||||
void HeapRegion::set_continues_humongous(HeapRegion* first_hr) {
|
||||
assert(!is_humongous(), "sanity / pre-condition");
|
||||
assert(end() == orig_end(),
|
||||
"Should be normal before the humongous object allocation");
|
||||
assert(top() == bottom(), "should be empty");
|
||||
assert(first_hr->startsHumongous(), "pre-condition");
|
||||
assert(first_hr->is_starts_humongous(), "pre-condition");
|
||||
|
||||
_type.set_continues_humongous();
|
||||
_humongous_start_region = first_hr;
|
||||
}
|
||||
|
||||
void HeapRegion::clear_humongous() {
|
||||
assert(isHumongous(), "pre-condition");
|
||||
assert(is_humongous(), "pre-condition");
|
||||
|
||||
if (startsHumongous()) {
|
||||
if (is_starts_humongous()) {
|
||||
assert(top() <= end(), "pre-condition");
|
||||
set_end(orig_end());
|
||||
if (top() > end()) {
|
||||
@ -654,7 +654,7 @@ void HeapRegion::verify_strong_code_roots(VerifyOption vo, bool* failures) const
|
||||
return;
|
||||
}
|
||||
|
||||
if (continuesHumongous()) {
|
||||
if (is_continues_humongous()) {
|
||||
if (strong_code_roots_length > 0) {
|
||||
gclog_or_tty->print_cr("region "HR_FORMAT" is a continuation of a humongous "
|
||||
"region but has "SIZE_FORMAT" code root entries",
|
||||
@ -781,7 +781,7 @@ public:
|
||||
HeapRegion* to = _g1h->heap_region_containing(obj);
|
||||
if (from != NULL && to != NULL &&
|
||||
from != to &&
|
||||
!to->isHumongous()) {
|
||||
!to->is_humongous()) {
|
||||
jbyte cv_obj = *_bs->byte_for_const(_containing_obj);
|
||||
jbyte cv_field = *_bs->byte_for_const(p);
|
||||
const jbyte dirty = CardTableModRefBS::dirty_card_val();
|
||||
@ -835,19 +835,19 @@ void HeapRegion::verify(VerifyOption vo,
|
||||
HeapWord* p = bottom();
|
||||
HeapWord* prev_p = NULL;
|
||||
VerifyLiveClosure vl_cl(g1, vo);
|
||||
bool is_humongous = isHumongous();
|
||||
bool is_region_humongous = is_humongous();
|
||||
size_t object_num = 0;
|
||||
while (p < top()) {
|
||||
oop obj = oop(p);
|
||||
size_t obj_size = block_size(p);
|
||||
object_num += 1;
|
||||
|
||||
if (is_humongous != g1->isHumongous(obj_size) &&
|
||||
if (is_region_humongous != g1->is_humongous(obj_size) &&
|
||||
!g1->is_obj_dead(obj, this)) { // Dead objects may have bigger block_size since they span several objects.
|
||||
gclog_or_tty->print_cr("obj "PTR_FORMAT" is of %shumongous size ("
|
||||
SIZE_FORMAT" words) in a %shumongous region",
|
||||
p, g1->isHumongous(obj_size) ? "" : "non-",
|
||||
obj_size, is_humongous ? "" : "non-");
|
||||
p, g1->is_humongous(obj_size) ? "" : "non-",
|
||||
obj_size, is_region_humongous ? "" : "non-");
|
||||
*failures = true;
|
||||
return;
|
||||
}
|
||||
@ -956,7 +956,7 @@ void HeapRegion::verify(VerifyOption vo,
|
||||
}
|
||||
}
|
||||
|
||||
if (is_humongous && object_num > 1) {
|
||||
if (is_region_humongous && object_num > 1) {
|
||||
gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] is humongous "
|
||||
"but has "SIZE_FORMAT", objects",
|
||||
bottom(), end(), object_num);
|
||||
|
||||
@ -417,9 +417,9 @@ class HeapRegion: public G1OffsetTableContigSpace {
|
||||
bool is_eden() const { return _type.is_eden(); }
|
||||
bool is_survivor() const { return _type.is_survivor(); }
|
||||
|
||||
bool isHumongous() const { return _type.is_humongous(); }
|
||||
bool startsHumongous() const { return _type.is_starts_humongous(); }
|
||||
bool continuesHumongous() const { return _type.is_continues_humongous(); }
|
||||
bool is_humongous() const { return _type.is_humongous(); }
|
||||
bool is_starts_humongous() const { return _type.is_starts_humongous(); }
|
||||
bool is_continues_humongous() const { return _type.is_continues_humongous(); }
|
||||
|
||||
bool is_old() const { return _type.is_old(); }
|
||||
|
||||
@ -431,10 +431,10 @@ class HeapRegion: public G1OffsetTableContigSpace {
|
||||
// Return the number of distinct regions that are covered by this region:
|
||||
// 1 if the region is not humongous, >= 1 if the region is humongous.
|
||||
uint region_num() const {
|
||||
if (!isHumongous()) {
|
||||
if (!is_humongous()) {
|
||||
return 1U;
|
||||
} else {
|
||||
assert(startsHumongous(), "doesn't make sense on HC regions");
|
||||
assert(is_starts_humongous(), "doesn't make sense on HC regions");
|
||||
assert(capacity() % HeapRegion::GrainBytes == 0, "sanity");
|
||||
return (uint) (capacity() >> HeapRegion::LogOfHRGrainBytes);
|
||||
}
|
||||
@ -443,7 +443,7 @@ class HeapRegion: public G1OffsetTableContigSpace {
|
||||
// Return the index + 1 of the last HC regions that's associated
|
||||
// with this HS region.
|
||||
uint last_hc_index() const {
|
||||
assert(startsHumongous(), "don't call this otherwise");
|
||||
assert(is_starts_humongous(), "don't call this otherwise");
|
||||
return hrm_index() + region_num();
|
||||
}
|
||||
|
||||
@ -478,12 +478,12 @@ class HeapRegion: public G1OffsetTableContigSpace {
|
||||
// humongous regions can be calculated by just looking at the
|
||||
// "starts humongous" regions and by ignoring the "continues
|
||||
// humongous" regions.
|
||||
void set_startsHumongous(HeapWord* new_top, HeapWord* new_end);
|
||||
void set_starts_humongous(HeapWord* new_top, HeapWord* new_end);
|
||||
|
||||
// Makes the current region be a "continues humongous'
|
||||
// region. first_hr is the "start humongous" region of the series
|
||||
// which this region will be part of.
|
||||
void set_continuesHumongous(HeapRegion* first_hr);
|
||||
void set_continues_humongous(HeapRegion* first_hr);
|
||||
|
||||
// Unsets the humongous-related fields on the region.
|
||||
void clear_humongous();
|
||||
@ -612,7 +612,7 @@ class HeapRegion: public G1OffsetTableContigSpace {
|
||||
bool is_marked() { return _prev_top_at_mark_start != bottom(); }
|
||||
|
||||
void reset_during_compaction() {
|
||||
assert(isHumongous() && startsHumongous(),
|
||||
assert(is_starts_humongous(),
|
||||
"should only be called for starts humongous regions");
|
||||
|
||||
zero_marked_bytes();
|
||||
|
||||
@ -282,7 +282,7 @@ void HeapRegionManager::par_iterate(HeapRegionClosure* blk, uint worker_id, uint
|
||||
// We'll ignore "continues humongous" regions (we'll process them
|
||||
// when we come across their corresponding "start humongous"
|
||||
// region) and regions already claimed.
|
||||
if (r->claim_value() == claim_value || r->continuesHumongous()) {
|
||||
if (r->claim_value() == claim_value || r->is_continues_humongous()) {
|
||||
continue;
|
||||
}
|
||||
// OK, try to claim it
|
||||
@ -290,7 +290,7 @@ void HeapRegionManager::par_iterate(HeapRegionClosure* blk, uint worker_id, uint
|
||||
continue;
|
||||
}
|
||||
// Success!
|
||||
if (r->startsHumongous()) {
|
||||
if (r->is_starts_humongous()) {
|
||||
// If the region is "starts humongous" we'll iterate over its
|
||||
// "continues humongous" first; in fact we'll do them
|
||||
// first. The order is important. In one case, calling the
|
||||
@ -302,7 +302,7 @@ void HeapRegionManager::par_iterate(HeapRegionClosure* blk, uint worker_id, uint
|
||||
for (uint ch_index = index + 1; ch_index < index + r->region_num(); ch_index++) {
|
||||
HeapRegion* chr = _regions.get_by_index(ch_index);
|
||||
|
||||
assert(chr->continuesHumongous(), "Must be humongous region");
|
||||
assert(chr->is_continues_humongous(), "Must be humongous region");
|
||||
assert(chr->humongous_start_region() == r,
|
||||
err_msg("Must work on humongous continuation of the original start region "
|
||||
PTR_FORMAT ", but is " PTR_FORMAT, p2i(r), p2i(chr)));
|
||||
@ -312,7 +312,7 @@ void HeapRegionManager::par_iterate(HeapRegionClosure* blk, uint worker_id, uint
|
||||
bool claim_result = chr->claimHeapRegion(claim_value);
|
||||
// We should always be able to claim it; no one else should
|
||||
// be trying to claim this region.
|
||||
guarantee(claim_result, "We should always be able to claim the continuesHumongous part of the humongous object");
|
||||
guarantee(claim_result, "We should always be able to claim the is_continues_humongous part of the humongous object");
|
||||
|
||||
bool res2 = blk->doHeapRegion(chr);
|
||||
if (res2) {
|
||||
@ -323,7 +323,7 @@ void HeapRegionManager::par_iterate(HeapRegionClosure* blk, uint worker_id, uint
|
||||
// does something with "continues humongous" regions
|
||||
// clears them). We might have to weaken it in the future,
|
||||
// but let's leave these two asserts here for extra safety.
|
||||
assert(chr->continuesHumongous(), "should still be the case");
|
||||
assert(chr->is_continues_humongous(), "should still be the case");
|
||||
assert(chr->humongous_start_region() == r, "sanity");
|
||||
}
|
||||
}
|
||||
@ -425,7 +425,7 @@ void HeapRegionManager::verify() {
|
||||
// this method may be called, we have only completed allocation of the regions,
|
||||
// but not put into a region set.
|
||||
prev_committed = true;
|
||||
if (hr->startsHumongous()) {
|
||||
if (hr->is_starts_humongous()) {
|
||||
prev_end = hr->orig_end();
|
||||
} else {
|
||||
prev_end = hr->end();
|
||||
|
||||
@ -41,7 +41,7 @@ void HeapRegionSetBase::fill_in_ext_msg(hrs_ext_msg* msg, const char* message) {
|
||||
void HeapRegionSetBase::verify_region(HeapRegion* hr) {
|
||||
assert(hr->containing_set() == this, err_msg("Inconsistent containing set for %u", hr->hrm_index()));
|
||||
assert(!hr->is_young(), err_msg("Adding young region %u", hr->hrm_index())); // currently we don't use these sets for young regions
|
||||
assert(hr->isHumongous() == regions_humongous(), err_msg("Wrong humongous state for region %u and set %s", hr->hrm_index(), name()));
|
||||
assert(hr->is_humongous() == regions_humongous(), err_msg("Wrong humongous state for region %u and set %s", hr->hrm_index(), name()));
|
||||
assert(hr->is_free() == regions_free(), err_msg("Wrong free state for region %u and set %s", hr->hrm_index(), name()));
|
||||
assert(!hr->is_free() || hr->is_empty(), err_msg("Free region %u is not empty for set %s", hr->hrm_index(), name()));
|
||||
assert(!hr->is_empty() || hr->is_free(), err_msg("Empty region %u is not free for set %s", hr->hrm_index(), name()));
|
||||
|
||||
@ -30,8 +30,8 @@ bool HeapRegionType::is_valid(Tag tag) {
|
||||
case FreeTag:
|
||||
case EdenTag:
|
||||
case SurvTag:
|
||||
case HumStartsTag:
|
||||
case HumContTag:
|
||||
case StartsHumongousTag:
|
||||
case ContinuesHumongousTag:
|
||||
case OldTag:
|
||||
return true;
|
||||
}
|
||||
@ -41,12 +41,12 @@ bool HeapRegionType::is_valid(Tag tag) {
|
||||
const char* HeapRegionType::get_str() const {
|
||||
hrt_assert_is_valid(_tag);
|
||||
switch (_tag) {
|
||||
case FreeTag: return "FREE";
|
||||
case EdenTag: return "EDEN";
|
||||
case SurvTag: return "SURV";
|
||||
case HumStartsTag: return "HUMS";
|
||||
case HumContTag: return "HUMC";
|
||||
case OldTag: return "OLD";
|
||||
case FreeTag: return "FREE";
|
||||
case EdenTag: return "EDEN";
|
||||
case SurvTag: return "SURV";
|
||||
case StartsHumongousTag: return "HUMS";
|
||||
case ContinuesHumongousTag: return "HUMC";
|
||||
case OldTag: return "OLD";
|
||||
}
|
||||
ShouldNotReachHere();
|
||||
// keep some compilers happy
|
||||
@ -56,12 +56,12 @@ const char* HeapRegionType::get_str() const {
|
||||
const char* HeapRegionType::get_short_str() const {
|
||||
hrt_assert_is_valid(_tag);
|
||||
switch (_tag) {
|
||||
case FreeTag: return "F";
|
||||
case EdenTag: return "E";
|
||||
case SurvTag: return "S";
|
||||
case HumStartsTag: return "HS";
|
||||
case HumContTag: return "HC";
|
||||
case OldTag: return "O";
|
||||
case FreeTag: return "F";
|
||||
case EdenTag: return "E";
|
||||
case SurvTag: return "S";
|
||||
case StartsHumongousTag: return "HS";
|
||||
case ContinuesHumongousTag: return "HC";
|
||||
case OldTag: return "O";
|
||||
}
|
||||
ShouldNotReachHere();
|
||||
// keep some compilers happy
|
||||
|
||||
@ -49,22 +49,22 @@ private:
|
||||
// 0001 1 [ 3] Survivor
|
||||
//
|
||||
// 0010 0 Humongous Mask
|
||||
// 0010 0 [ 4] Humongous Starts
|
||||
// 0010 1 [ 5] Humongous Continues
|
||||
// 0010 0 [ 4] Starts Humongous
|
||||
// 0010 1 [ 5] Continues Humongous
|
||||
//
|
||||
// 01000 [ 8] Old
|
||||
typedef enum {
|
||||
FreeTag = 0,
|
||||
FreeTag = 0,
|
||||
|
||||
YoungMask = 2,
|
||||
EdenTag = YoungMask,
|
||||
SurvTag = YoungMask + 1,
|
||||
YoungMask = 2,
|
||||
EdenTag = YoungMask,
|
||||
SurvTag = YoungMask + 1,
|
||||
|
||||
HumMask = 4,
|
||||
HumStartsTag = HumMask,
|
||||
HumContTag = HumMask + 1,
|
||||
HumongousMask = 4,
|
||||
StartsHumongousTag = HumongousMask,
|
||||
ContinuesHumongousTag = HumongousMask + 1,
|
||||
|
||||
OldTag = 8
|
||||
OldTag = 8
|
||||
} Tag;
|
||||
|
||||
volatile Tag _tag;
|
||||
@ -104,9 +104,9 @@ public:
|
||||
bool is_eden() const { return get() == EdenTag; }
|
||||
bool is_survivor() const { return get() == SurvTag; }
|
||||
|
||||
bool is_humongous() const { return (get() & HumMask) != 0; }
|
||||
bool is_starts_humongous() const { return get() == HumStartsTag; }
|
||||
bool is_continues_humongous() const { return get() == HumContTag; }
|
||||
bool is_humongous() const { return (get() & HumongousMask) != 0; }
|
||||
bool is_starts_humongous() const { return get() == StartsHumongousTag; }
|
||||
bool is_continues_humongous() const { return get() == ContinuesHumongousTag; }
|
||||
|
||||
bool is_old() const { return get() == OldTag; }
|
||||
|
||||
@ -118,8 +118,8 @@ public:
|
||||
void set_eden_pre_gc() { set_from(EdenTag, SurvTag); }
|
||||
void set_survivor() { set_from(SurvTag, FreeTag); }
|
||||
|
||||
void set_starts_humongous() { set_from(HumStartsTag, FreeTag); }
|
||||
void set_continues_humongous() { set_from(HumContTag, FreeTag); }
|
||||
void set_starts_humongous() { set_from(StartsHumongousTag, FreeTag); }
|
||||
void set_continues_humongous() { set_from(ContinuesHumongousTag, FreeTag); }
|
||||
|
||||
void set_old() { set(OldTag); }
|
||||
|
||||
|
||||
@ -257,7 +257,7 @@ WB_ENTRY(jboolean, WB_G1IsHumongous(JNIEnv* env, jobject o, jobject obj))
|
||||
G1CollectedHeap* g1 = G1CollectedHeap::heap();
|
||||
oop result = JNIHandles::resolve(obj);
|
||||
const HeapRegion* hr = g1->heap_region_containing(result);
|
||||
return hr->isHumongous();
|
||||
return hr->is_humongous();
|
||||
WB_END
|
||||
|
||||
WB_ENTRY(jlong, WB_G1NumFreeRegions(JNIEnv* env, jobject o))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user