diff --git a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp index bd649b2f2f0..95304cc33d9 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp @@ -184,25 +184,17 @@ public: virtual bool do_metadata() { return true; } }; -class ShenandoahUpdateHeapRefsSuperClosure : public BasicOopIterateClosure { +class ShenandoahUpdateHeapRefsClosure : public BasicOopIterateClosure { private: ShenandoahHeap* _heap; + + template + void do_oop_work(T* p); + public: - ShenandoahUpdateHeapRefsSuperClosure() : + ShenandoahUpdateHeapRefsClosure() : _heap(ShenandoahHeap::heap()) {} - template - void work(T *p); -}; - -class ShenandoahUpdateHeapRefsClosure : public ShenandoahUpdateHeapRefsSuperClosure { -private: - template - inline void do_oop_work(T* p) { work(p); } - -public: - ShenandoahUpdateHeapRefsClosure() : ShenandoahUpdateHeapRefsSuperClosure() {} - virtual void do_oop(narrowOop* p) { do_oop_work(p); } virtual void do_oop(oop* p) { do_oop_work(p); } }; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp index e827c86a229..23d5bc17a3b 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp @@ -34,7 +34,7 @@ inline void ShenandoahMarkRefsSuperClosure::work(T *p) { } template -inline void ShenandoahUpdateHeapRefsSuperClosure::work(T* p) { +inline void ShenandoahUpdateHeapRefsClosure::do_oop_work(T* p) { _heap->maybe_update_with_forwarded(p); }