8304055: G1: Remove OldGCAllocRegion::release

Reviewed-by: iwalulya, tschatzl
This commit is contained in:
Albert Mingkun Yang 2023-03-16 13:16:32 +00:00
parent b5108b4f37
commit f629152021
2 changed files with 0 additions and 35 deletions

View File

@ -364,31 +364,3 @@ size_t G1GCAllocRegion::retire(bool fill_up) {
} }
return end_waste; return end_waste;
} }
HeapRegion* OldGCAllocRegion::release() {
HeapRegion* cur = get();
if (cur != NULL) {
// Determine how far we are from the next card boundary. If it is smaller than
// the minimum object size we can allocate into, expand into the next card.
HeapWord* top = cur->top();
HeapWord* aligned_top = align_up(top, BOTConstants::card_size());
size_t to_allocate_words = pointer_delta(aligned_top, top, HeapWordSize);
if (to_allocate_words != 0) {
// We are not at a card boundary. Fill up, possibly into the next, taking the
// end of the region and the minimum object size into account.
to_allocate_words = MIN2(pointer_delta(cur->end(), cur->top(), HeapWordSize),
MAX2(to_allocate_words, G1CollectedHeap::min_fill_size()));
// Skip allocation if there is not enough space to allocate even the smallest
// possible object. In this case this region will not be retained, so the
// original problem cannot occur.
if (to_allocate_words >= G1CollectedHeap::min_fill_size()) {
HeapWord* dummy = attempt_allocation(to_allocate_words);
cur->fill_with_dummy_object(dummy, to_allocate_words);
}
}
}
return G1AllocRegion::release();
}

View File

@ -275,13 +275,6 @@ class OldGCAllocRegion : public G1GCAllocRegion {
public: public:
OldGCAllocRegion(G1EvacStats* stats) OldGCAllocRegion(G1EvacStats* stats)
: G1GCAllocRegion("Old GC Alloc Region", true /* bot_updates */, stats, G1HeapRegionAttr::Old) { } : G1GCAllocRegion("Old GC Alloc Region", true /* bot_updates */, stats, G1HeapRegionAttr::Old) { }
// This specialization of release() makes sure that the last card that has
// been allocated into has been completely filled by a dummy object. This
// avoids races when remembered set scanning wants to update the BOT of the
// last card in the retained old gc alloc region, and allocation threads
// allocating into that card at the same time.
virtual HeapRegion* release();
}; };
#endif // SHARE_GC_G1_G1ALLOCREGION_HPP #endif // SHARE_GC_G1_G1ALLOCREGION_HPP