From 115f4193eb39d8469ac8127e38798a3f041c22e0 Mon Sep 17 00:00:00 2001 From: Guoxiong Li Date: Mon, 8 Apr 2024 16:10:07 +0000 Subject: [PATCH] 8329659: Serial: Extract allowed_dead_ratio from ContiguousSpace Reviewed-by: ayang, iwalulya --- src/hotspot/share/gc/serial/serialFullGC.cpp | 3 ++- src/hotspot/share/gc/shared/space.cpp | 4 ---- src/hotspot/share/gc/shared/space.hpp | 6 ------ 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/hotspot/share/gc/serial/serialFullGC.cpp b/src/hotspot/share/gc/serial/serialFullGC.cpp index 6471e13f449..d6398aa9fc1 100644 --- a/src/hotspot/share/gc/serial/serialFullGC.cpp +++ b/src/hotspot/share/gc/serial/serialFullGC.cpp @@ -97,7 +97,8 @@ class DeadSpacer : StackObj { public: DeadSpacer(ContiguousSpace* space) : _allowed_deadspace_words(0), _space(space) { - size_t ratio = _space->allowed_dead_ratio(); + size_t ratio = (_space == SerialHeap::heap()->old_gen()->space()) + ? MarkSweepDeadRatio : 0; _active = ratio > 0; if (_active) { diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp index ef8f648b18e..f5622cd64de 100644 --- a/src/hotspot/share/gc/shared/space.cpp +++ b/src/hotspot/share/gc/shared/space.cpp @@ -213,8 +213,4 @@ TenuredSpace::TenuredSpace(SerialBlockOffsetTable* offsets, { initialize(mr, SpaceDecorator::Clear, SpaceDecorator::Mangle); } - -size_t TenuredSpace::allowed_dead_ratio() const { - return MarkSweepDeadRatio; -} #endif // INCLUDE_SERIALGC diff --git a/src/hotspot/share/gc/shared/space.hpp b/src/hotspot/share/gc/shared/space.hpp index 33ef4b01e01..a4679b3adad 100644 --- a/src/hotspot/share/gc/shared/space.hpp +++ b/src/hotspot/share/gc/shared/space.hpp @@ -135,10 +135,6 @@ public: _next_compaction_space = csp; } - // The maximum percentage of objects that can be dead in the compacted - // live part of a compacted space ("deadwood" support.) - virtual size_t allowed_dead_ratio() const { return 0; }; - // Accessors HeapWord* top() const { return _top; } void set_top(HeapWord* value) { _top = value; } @@ -196,8 +192,6 @@ class TenuredSpace: public ContiguousSpace { protected: SerialBlockOffsetTable* _offsets; - // Mark sweep support - size_t allowed_dead_ratio() const override; public: // Constructor TenuredSpace(SerialBlockOffsetTable* offsets,