diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp index d672b2b690c..1e4f7c856b0 100644 --- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp +++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp @@ -958,18 +958,10 @@ void PSParallelCompact::summary_phase() } } -// This method should contain all heap-specific policy for invoking a full -// collection. invoke_no_policy() will only attempt to compact the heap; it -// will do nothing further. If we need to bail out for policy reasons, scavenge -// before full gc, or any other specialized behavior, it needs to be added here. -// +// This method invokes a full collection. The argument controls whether +// soft-refs should be cleared or not. // Note that this method should only be called from the vm_thread while at a // safepoint. -// -// Note that the all_soft_refs_clear flag in the soft ref policy -// may be true because this method can be called without intervening -// activity. For example when the heap space is tight and full measure -// are being taken to free space. bool PSParallelCompact::invoke(bool clear_all_soft_refs) { assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); assert(Thread::current() == (Thread*)VMThread::vm_thread(), @@ -978,10 +970,6 @@ bool PSParallelCompact::invoke(bool clear_all_soft_refs) { SvcGCMarker sgcm(SvcGCMarker::FULL); IsSTWGCActiveMark mark; - ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); - clear_all_soft_refs = clear_all_soft_refs - || heap->soft_ref_policy()->should_clear_all_soft_refs(); - return PSParallelCompact::invoke_no_policy(clear_all_soft_refs); } @@ -1001,11 +989,6 @@ bool PSParallelCompact::invoke_no_policy(bool clear_all_soft_refs) { PSOldGen* old_gen = heap->old_gen(); PSAdaptiveSizePolicy* size_policy = heap->size_policy(); - // The scope of casr should end after code that can change - // SoftRefPolicy::_should_clear_all_soft_refs. - ClearedAllSoftRefs casr(clear_all_soft_refs, - heap->soft_ref_policy()); - // Make sure data structures are sane, make the heap parsable, and do other // miscellaneous bookkeeping. pre_compact(); diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.hpp b/src/hotspot/share/gc/parallel/psParallelCompact.hpp index 0584fc64d73..a0118717f9d 100644 --- a/src/hotspot/share/gc/parallel/psParallelCompact.hpp +++ b/src/hotspot/share/gc/parallel/psParallelCompact.hpp @@ -761,8 +761,8 @@ private: public: static void fill_dead_objs_in_dense_prefix(uint worker_id, uint num_workers); - static bool invoke(bool maximum_heap_compaction); - static bool invoke_no_policy(bool maximum_heap_compaction); + static bool invoke(bool clear_all_soft_refs); + static bool invoke_no_policy(bool clear_all_soft_refs); template static void adjust_in_space_helper(SpaceId id, volatile uint* claim_counter, Func&& on_stripe);