From f629152021d4ce0288119c47d5a111b87dce1de6 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Thu, 16 Mar 2023 13:16:32 +0000 Subject: [PATCH] 8304055: G1: Remove OldGCAllocRegion::release Reviewed-by: iwalulya, tschatzl --- src/hotspot/share/gc/g1/g1AllocRegion.cpp | 28 ----------------------- src/hotspot/share/gc/g1/g1AllocRegion.hpp | 7 ------ 2 files changed, 35 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1AllocRegion.cpp b/src/hotspot/share/gc/g1/g1AllocRegion.cpp index f80ac4e524d..3a7f41535a2 100644 --- a/src/hotspot/share/gc/g1/g1AllocRegion.cpp +++ b/src/hotspot/share/gc/g1/g1AllocRegion.cpp @@ -364,31 +364,3 @@ size_t G1GCAllocRegion::retire(bool fill_up) { } 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(); -} diff --git a/src/hotspot/share/gc/g1/g1AllocRegion.hpp b/src/hotspot/share/gc/g1/g1AllocRegion.hpp index a609472a5c9..5fdd37d3a01 100644 --- a/src/hotspot/share/gc/g1/g1AllocRegion.hpp +++ b/src/hotspot/share/gc/g1/g1AllocRegion.hpp @@ -275,13 +275,6 @@ class OldGCAllocRegion : public G1GCAllocRegion { public: OldGCAllocRegion(G1EvacStats* stats) : 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