--- old/src/hotspot/share/gc/g1/g1OopClosures.hpp 2018-11-26 21:50:54.008478557 +0100 +++ new/src/hotspot/share/gc/g1/g1OopClosures.hpp 2018-11-26 21:50:53.576476414 +0100 @@ -83,6 +83,16 @@ virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; +// Used during Optional RS scanning to make sure we trim the queues in a timely manner. +class G1ScanRSForOptionalClosure : public OopClosure { + G1ScanObjsDuringScanRSClosure* _scan_cl; +public: + G1ScanRSForOptionalClosure(G1ScanObjsDuringScanRSClosure* cl) : _scan_cl(cl) { } + + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } +}; // This closure is applied to the fields of the objects that have just been copied during evacuation. class G1ScanEvacuatedObjClosure : public G1ScanClosureBase {