From 004b3ee748a266c6a4ccb773897a365263e2a5db Mon Sep 17 00:00:00 2001
From: Roman Kennke <rkennke@openjdk.org>
Date: Wed, 27 Mar 2019 22:25:03 +0100
Subject: [PATCH] 8220664: Simplify ShenandoahUpdateHeapRefsClosure

Reviewed-by: shade
---
 .../gc/shenandoah/shenandoahOopClosures.hpp   | 20 ++++++-------------
 .../shenandoahOopClosures.inline.hpp          |  2 +-
 2 files changed, 7 insertions(+), 15 deletions(-)

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 <class T>
+  void do_oop_work(T* p);
+
 public:
-  ShenandoahUpdateHeapRefsSuperClosure() :
+  ShenandoahUpdateHeapRefsClosure() :
     _heap(ShenandoahHeap::heap()) {}
 
-  template <class T>
-  void work(T *p);
-};
-
-class ShenandoahUpdateHeapRefsClosure : public ShenandoahUpdateHeapRefsSuperClosure {
-private:
-  template <class T>
-  inline  void do_oop_work(T* p)    { work<T>(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 <class T>
-inline void ShenandoahUpdateHeapRefsSuperClosure::work(T* p) {
+inline void ShenandoahUpdateHeapRefsClosure::do_oop_work(T* p) {
   _heap->maybe_update_with_forwarded(p);
 }