8220664: Simplify ShenandoahUpdateHeapRefsClosure

Reviewed-by: shade
This commit is contained in:
Roman Kennke 2019-03-27 22:25:03 +01:00
parent 518e3a8788
commit 004b3ee748
2 changed files with 7 additions and 15 deletions

View File

@ -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); }
};

View File

@ -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);
}