Skip to content

8365237: Remove unused SoftRefPolicy::_all_soft_refs_clear #26722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/hotspot/share/gc/shared/gcVMOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ void VM_Verify::doit() {
Universe::verify();
}

VM_GC_Operation::~VM_GC_Operation() {
CollectedHeap* ch = Universe::heap();
ch->soft_ref_policy()->set_all_soft_refs_clear(false);
}

const char* VM_GC_Operation::cause() const {
return GCCause::to_string(_gc_cause);
}
Expand Down
9 changes: 0 additions & 9 deletions src/hotspot/share/gc/shared/gcVMOperations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,7 @@ class VM_GC_Operation: public VM_Heap_Sync_Operation {
_gc_cause = _cause;

_full_gc_count_before = full_gc_count_before;
// In ParallelScavengeHeap::mem_allocate() collections can be
// executed within a loop and _all_soft_refs_clear can be set
// true after they have been cleared by a collection and another
// collection started so that _all_soft_refs_clear can be true
// when this collection is started. Don't assert that
// _all_soft_refs_clear have to be false here even though
// mutators have run. Soft refs will be cleared again in this
// collection.
}
~VM_GC_Operation();

virtual const char* cause() const;

Expand Down
21 changes: 1 addition & 20 deletions src/hotspot/share/gc/shared/softRefPolicy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,18 @@
#ifndef SHARE_GC_SHARED_SOFTREFPOLICY_HPP
#define SHARE_GC_SHARED_SOFTREFPOLICY_HPP

#include "memory/allocation.hpp"

class SoftRefPolicy {
private:
// Set to true when policy wants soft refs cleared.
// Reset to false by gc after it clears all soft refs.
bool _should_clear_all_soft_refs;

// Set to true by the GC if the just-completed gc cleared all
// softrefs. This is set to true whenever a gc clears all softrefs, and
// set to false each time gc returns to the mutator. For example, in the
// ParallelScavengeHeap case the latter would be done toward the end of
// mem_allocate() where it returns op.result()
bool _all_soft_refs_clear;

public:
SoftRefPolicy() :
_should_clear_all_soft_refs(false),
_all_soft_refs_clear(false) {}
_should_clear_all_soft_refs(false) {}

bool should_clear_all_soft_refs() { return _should_clear_all_soft_refs; }
void set_should_clear_all_soft_refs(bool v) { _should_clear_all_soft_refs = v; }

bool all_soft_refs_clear() { return _all_soft_refs_clear; }
void set_all_soft_refs_clear(bool v) { _all_soft_refs_clear = v; }

// Called by the GC after Soft Refs have been cleared to indicate
// that the request in _should_clear_all_soft_refs has been fulfilled.
void cleared_all_soft_refs() {
_all_soft_refs_clear = true;
}
};

#endif // SHARE_GC_SHARED_SOFTREFPOLICY_HPP