Skip to content

Commit

Permalink
8329659: Serial: Extract allowed_dead_ratio from ContiguousSpace
Browse files Browse the repository at this point in the history
Reviewed-by: ayang, iwalulya
  • Loading branch information
lgxbslgx committed Apr 8, 2024
1 parent 9ac3b77 commit 115f419
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/hotspot/share/gc/serial/serialFullGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/gc/shared/space.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 0 additions & 6 deletions src/hotspot/share/gc/shared/space.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ class ContiguousSpace: public CHeapObj<mtGC> {
_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; }
Expand Down Expand Up @@ -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,
Expand Down

1 comment on commit 115f419

@openjdk-notifier
Copy link

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.