8220664: Simplify ShenandoahUpdateHeapRefsClosure
Reviewed-by: shade
This commit is contained in:
parent
518e3a8788
commit
004b3ee748
@ -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); }
|
||||
};
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user