8342119: Shenandoah: Remove extra ShenandoahUpdateRefsClosure
Reviewed-by: wkemper, kdnilsen, rkennke
This commit is contained in:
parent
83e9e482b1
commit
b993227e2f
@ -77,18 +77,6 @@ public:
|
||||
inline void do_nmethod(nmethod* nm);
|
||||
};
|
||||
|
||||
class ShenandoahUpdateRefsClosure: public ShenandoahOopClosureBase {
|
||||
private:
|
||||
ShenandoahHeap* _heap;
|
||||
public:
|
||||
inline ShenandoahUpdateRefsClosure();
|
||||
inline void do_oop(oop* p);
|
||||
inline void do_oop(narrowOop* p);
|
||||
private:
|
||||
template <class T>
|
||||
inline void do_oop_work(T* p);
|
||||
};
|
||||
|
||||
template <bool concurrent, bool stable_thread>
|
||||
class ShenandoahEvacuateUpdateRootClosureBase : public ShenandoahOopClosureBase {
|
||||
protected:
|
||||
|
@ -97,18 +97,6 @@ void ShenandoahKeepAliveClosure::do_oop_work(T* p) {
|
||||
}
|
||||
}
|
||||
|
||||
ShenandoahUpdateRefsClosure::ShenandoahUpdateRefsClosure() :
|
||||
_heap(ShenandoahHeap::heap()) {
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void ShenandoahUpdateRefsClosure::do_oop_work(T* p) {
|
||||
_heap->update_with_forwarded(p);
|
||||
}
|
||||
|
||||
void ShenandoahUpdateRefsClosure::do_oop(oop* p) { do_oop_work(p); }
|
||||
void ShenandoahUpdateRefsClosure::do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
|
||||
template <bool concurrent, bool stable_thread>
|
||||
ShenandoahEvacuateUpdateRootClosureBase<concurrent, stable_thread>::ShenandoahEvacuateUpdateRootClosureBase() :
|
||||
_heap(ShenandoahHeap::heap()), _thread(stable_thread ? Thread::current() : nullptr) {
|
||||
|
@ -931,7 +931,10 @@ void ShenandoahConcurrentGC::op_updaterefs() {
|
||||
|
||||
class ShenandoahUpdateThreadClosure : public HandshakeClosure {
|
||||
private:
|
||||
ShenandoahUpdateRefsClosure _cl;
|
||||
// This closure runs when thread is stopped for handshake, which means
|
||||
// we can use non-concurrent closure here, as long as it only updates
|
||||
// locations modified by the thread itself, i.e. stack locations.
|
||||
ShenandoahNonConcUpdateRefsClosure _cl;
|
||||
public:
|
||||
ShenandoahUpdateThreadClosure();
|
||||
void do_thread(Thread* thread);
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "gc/shenandoah/shenandoahClosures.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahGC.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeap.hpp"
|
||||
#include "gc/shenandoah/shenandoahOopClosures.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahPhaseTimings.hpp"
|
||||
#include "gc/shenandoah/shenandoahRootProcessor.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahUtils.hpp"
|
||||
@ -66,13 +67,13 @@ public:
|
||||
assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint");
|
||||
ShenandoahParallelWorkerSession worker_session(worker_id);
|
||||
|
||||
ShenandoahUpdateRefsClosure cl;
|
||||
ShenandoahNonConcUpdateRefsClosure cl;
|
||||
if (_check_alive) {
|
||||
ShenandoahForwardedIsAliveClosure is_alive;
|
||||
_root_updater->roots_do<ShenandoahForwardedIsAliveClosure, ShenandoahUpdateRefsClosure>(worker_id, &is_alive, &cl);
|
||||
_root_updater->roots_do<ShenandoahForwardedIsAliveClosure, ShenandoahNonConcUpdateRefsClosure>(worker_id, &is_alive, &cl);
|
||||
} else {
|
||||
AlwaysTrueClosure always_true;;
|
||||
_root_updater->roots_do<AlwaysTrueClosure, ShenandoahUpdateRefsClosure>(worker_id, &always_true, &cl);
|
||||
AlwaysTrueClosure always_true;
|
||||
_root_updater->roots_do<AlwaysTrueClosure, ShenandoahNonConcUpdateRefsClosure>(worker_id, &always_true, &cl);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -2012,8 +2012,8 @@ void ShenandoahHeap::stw_process_weak_roots(bool full_gc) {
|
||||
// Cleanup weak roots
|
||||
if (has_forwarded_objects()) {
|
||||
ShenandoahForwardedIsAliveClosure is_alive;
|
||||
ShenandoahUpdateRefsClosure keep_alive;
|
||||
ShenandoahParallelWeakRootsCleaningTask<ShenandoahForwardedIsAliveClosure, ShenandoahUpdateRefsClosure>
|
||||
ShenandoahNonConcUpdateRefsClosure keep_alive;
|
||||
ShenandoahParallelWeakRootsCleaningTask<ShenandoahForwardedIsAliveClosure, ShenandoahNonConcUpdateRefsClosure>
|
||||
cleaning_task(timing_phase, &is_alive, &keep_alive, num_workers);
|
||||
_workers->run_task(&cleaning_task);
|
||||
} else {
|
||||
@ -2197,7 +2197,7 @@ public:
|
||||
do_work<ShenandoahConcUpdateRefsClosure>(worker_id);
|
||||
} else {
|
||||
ShenandoahParallelWorkerSession worker_session(worker_id);
|
||||
do_work<ShenandoahSTWUpdateRefsClosure>(worker_id);
|
||||
do_work<ShenandoahNonConcUpdateRefsClosure>(worker_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -660,7 +660,7 @@ public:
|
||||
inline void conc_update_with_forwarded(T* p);
|
||||
|
||||
template <class T>
|
||||
inline void update_with_forwarded(T* p);
|
||||
inline void non_conc_update_with_forwarded(T* p);
|
||||
|
||||
static inline void atomic_update_oop(oop update, oop* addr, oop compare);
|
||||
static inline void atomic_update_oop(oop update, narrowOop* addr, oop compare);
|
||||
|
@ -108,7 +108,7 @@ inline void ShenandoahHeap::leave_evacuation(Thread* t) {
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline void ShenandoahHeap::update_with_forwarded(T* p) {
|
||||
inline void ShenandoahHeap::non_conc_update_with_forwarded(T* p) {
|
||||
T o = RawAccess<>::oop_load(p);
|
||||
if (!CompressedOops::is_null(o)) {
|
||||
oop obj = CompressedOops::decode_not_null(o);
|
||||
|
@ -94,7 +94,6 @@ public:
|
||||
virtual void do_oop(oop* p) { do_oop_work(p); }
|
||||
};
|
||||
|
||||
|
||||
class ShenandoahUpdateRefsSuperClosure : public ShenandoahOopClosureBase {
|
||||
protected:
|
||||
ShenandoahHeap* _heap;
|
||||
@ -103,15 +102,13 @@ public:
|
||||
ShenandoahUpdateRefsSuperClosure() : _heap(ShenandoahHeap::heap()) {}
|
||||
};
|
||||
|
||||
class ShenandoahSTWUpdateRefsClosure : public ShenandoahUpdateRefsSuperClosure {
|
||||
class ShenandoahNonConcUpdateRefsClosure : public ShenandoahUpdateRefsSuperClosure {
|
||||
private:
|
||||
template<class T>
|
||||
inline void work(T* p);
|
||||
|
||||
public:
|
||||
ShenandoahSTWUpdateRefsClosure() : ShenandoahUpdateRefsSuperClosure() {
|
||||
assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must only be used at safepoints");
|
||||
}
|
||||
ShenandoahNonConcUpdateRefsClosure() : ShenandoahUpdateRefsSuperClosure() {}
|
||||
|
||||
virtual void do_oop(narrowOop* p) { work(p); }
|
||||
virtual void do_oop(oop* p) { work(p); }
|
||||
|
@ -39,15 +39,15 @@ template<ShenandoahGenerationType GENERATION>
|
||||
template<class T>
|
||||
inline void ShenandoahMarkUpdateRefsClosure<GENERATION>::work(T* p) {
|
||||
// Update the location
|
||||
_heap->update_with_forwarded(p);
|
||||
_heap->non_conc_update_with_forwarded(p);
|
||||
|
||||
// ...then do the usual thing
|
||||
ShenandoahMarkRefsSuperClosure::work<T, GENERATION>(p);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void ShenandoahSTWUpdateRefsClosure::work(T* p) {
|
||||
_heap->update_with_forwarded(p);
|
||||
inline void ShenandoahNonConcUpdateRefsClosure::work(T* p) {
|
||||
_heap->non_conc_update_with_forwarded(p);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
Loading…
Reference in New Issue
Block a user