# HG changeset patch # User ehelin # Date 1498653490 -7200 # Node ID cd27cb97655c13c242f983ddadcce0b911ba08c3 # Parent f1c04490ded12b2bfed1a111d4f268cddf289c18 8183124: Remove OopsInHeapRegionClosure Reviewed-by: sjohanss, tschatzl diff -r f1c04490ded1 -r cd27cb97655c hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp Wed Jun 28 19:12:58 2017 -0400 +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp Wed Jun 28 14:38:10 2017 +0200 @@ -60,7 +60,6 @@ class HeapRegion; class HRRSCleanupTask; class GenerationSpec; -class OopsInHeapRegionClosure; class G1ParScanThreadState; class G1ParScanThreadStateSet; class G1KlassScanClosure; diff -r f1c04490ded1 -r cd27cb97655c hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp --- a/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp Wed Jun 28 19:12:58 2017 -0400 +++ b/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp Wed Jun 28 14:38:10 2017 +0200 @@ -35,15 +35,16 @@ #include "gc/g1/heapRegionRemSet.hpp" #include "gc/shared/preservedMarks.inline.hpp" -class UpdateRSetDeferred : public OopsInHeapRegionClosure { +class UpdateRSetDeferred : public ExtendedOopClosure { private: G1CollectedHeap* _g1; DirtyCardQueue *_dcq; G1SATBCardTableModRefBS* _ct_bs; + HeapRegion* _from; public: UpdateRSetDeferred(DirtyCardQueue* dcq) : - _g1(G1CollectedHeap::heap()), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq) {} + _g1(G1CollectedHeap::heap()), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq), _from(NULL) {} virtual void do_oop(narrowOop* p) { do_oop_work(p); } virtual void do_oop( oop* p) { do_oop_work(p); } @@ -58,6 +59,8 @@ } } } + + void set_region(HeapRegion* from) { _from = from; } }; class RemoveSelfForwardPtrObjClosure: public ObjectClosure { @@ -66,14 +69,14 @@ G1ConcurrentMark* _cm; HeapRegion* _hr; size_t _marked_bytes; - OopsInHeapRegionClosure *_update_rset_cl; + UpdateRSetDeferred* _update_rset_cl; bool _during_initial_mark; uint _worker_id; HeapWord* _last_forwarded_object_end; public: RemoveSelfForwardPtrObjClosure(HeapRegion* hr, - OopsInHeapRegionClosure* update_rset_cl, + UpdateRSetDeferred* update_rset_cl, bool during_initial_mark, uint worker_id) : _g1(G1CollectedHeap::heap()), diff -r f1c04490ded1 -r cd27cb97655c hotspot/src/share/vm/gc/g1/g1OopClosures.cpp --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp Wed Jun 28 19:12:58 2017 -0400 +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp Wed Jun 28 14:38:10 2017 +0200 @@ -39,7 +39,7 @@ { } G1ScanClosureBase::G1ScanClosureBase(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : - _g1(g1), _par_scan_state(par_scan_state) + _g1(g1), _par_scan_state(par_scan_state), _from(NULL) { } void G1KlassScanClosure::do_klass(Klass* klass) { diff -r f1c04490ded1 -r cd27cb97655c hotspot/src/share/vm/gc/g1/g1OopClosures.hpp --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp Wed Jun 28 19:12:58 2017 -0400 +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp Wed Jun 28 14:38:10 2017 +0200 @@ -39,19 +39,11 @@ class G1CMTask; class ReferenceProcessor; -// A class that scans oops in a given heap region (much as OopsInGenClosure -// scans oops in a generation.) -class OopsInHeapRegionClosure: public ExtendedOopClosure { -protected: - HeapRegion* _from; -public: - void set_region(HeapRegion* from) { _from = from; } -}; - -class G1ScanClosureBase : public OopsInHeapRegionClosure { +class G1ScanClosureBase : public ExtendedOopClosure { protected: G1CollectedHeap* _g1; G1ParScanThreadState* _par_scan_state; + HeapRegion* _from; G1ScanClosureBase(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state); ~G1ScanClosureBase() { } @@ -64,6 +56,7 @@ public: // This closure needs special handling for InstanceRefKlass. virtual ReferenceIterationMode reference_iteration_mode() { return DO_DISCOVERED_AND_DISCOVERY; } + void set_region(HeapRegion* from) { _from = from; } }; // Used during the Update RS phase to refine remaining cards in the DCQ during garbage collection.