Skip to content

Commit

Permalink
8342081: Shenandoah: Remove extra ShenandoahMarkUpdateRefsSuperClosure
Browse files Browse the repository at this point in the history
Reviewed-by: ysr
  • Loading branch information
shipilev committed Oct 16, 2024
1 parent e4ff553 commit 724de68
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
26 changes: 8 additions & 18 deletions src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,33 +61,23 @@ class ShenandoahMarkRefsSuperClosure : public MetadataVisitingOopIterateClosure
}
};

class ShenandoahMarkUpdateRefsSuperClosure : public ShenandoahMarkRefsSuperClosure {
protected:
template <ShenandoahGenerationType GENERATION>
class ShenandoahMarkUpdateRefsClosure : public ShenandoahMarkRefsSuperClosure {
private:
ShenandoahHeap* const _heap;

template <class T, ShenandoahGenerationType GENERATION>
template <class T>
inline void work(T* p);

public:
ShenandoahMarkUpdateRefsSuperClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) :
ShenandoahMarkUpdateRefsClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) :
ShenandoahMarkRefsSuperClosure(q, rp),
_heap(ShenandoahHeap::heap()) {
assert(_heap->is_stw_gc_in_progress(), "Can only be used for STW GC");
};
};

template <ShenandoahGenerationType GENERATION>
class ShenandoahMarkUpdateRefsClosure : public ShenandoahMarkUpdateRefsSuperClosure {
private:
template <class T>
inline void do_oop_work(T* p) { work<T, GENERATION>(p); }

public:
ShenandoahMarkUpdateRefsClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) :
ShenandoahMarkUpdateRefsSuperClosure(q, rp) {}
}

virtual void do_oop(narrowOop* p) { do_oop_work(p); }
virtual void do_oop(oop* p) { do_oop_work(p); }
virtual void do_oop(narrowOop* p) { work(p); }
virtual void do_oop(oop* p) { work(p); }
};

template <ShenandoahGenerationType GENERATION>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ inline void ShenandoahMarkRefsSuperClosure::work(T* p) {
ShenandoahMark::mark_through_ref<T, GENERATION>(p, _queue, _mark_context, _weak);
}

template<class T, ShenandoahGenerationType GENERATION>
inline void ShenandoahMarkUpdateRefsSuperClosure::work(T* p) {
template<ShenandoahGenerationType GENERATION>
template<class T>
inline void ShenandoahMarkUpdateRefsClosure<GENERATION>::work(T* p) {
// Update the location
_heap->update_with_forwarded(p);

Expand Down

0 comments on commit 724de68

Please sign in to comment.