src/share/vm/gc_implementation/g1/g1OopClosures.hpp

Print this page
rev 6336 : 8040977: G1 crashes when run with -XX:-G1DeferredRSUpdate
Summary: When G1 is run with -XX:-G1DeferredRSUpdate, the VM crashes because of wrong initialization order of member variables. The change makes the initalization explicit, not relying on initialization order any more.
Reviewed-by: brutisso, mgerdin

*** 49,60 **** --- 49,65 ---- protected: G1CollectedHeap* _g1; G1ParScanThreadState* _par_scan_state; uint _worker_id; public: + // Initializes the instance, leaving _par_scan_state uninitialized. Must be done + // later using the set_par_scan_thread_state() method. + G1ParClosureSuper(G1CollectedHeap* g1); G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state); bool apply_to_weak_ref_discovered_field() { return true; } + + void set_par_scan_thread_state(G1ParScanThreadState* par_scan_state); }; class G1ParPushHeapRSClosure : public G1ParClosureSuper { public: G1ParPushHeapRSClosure(G1CollectedHeap* g1,
*** 66,78 **** virtual void do_oop(narrowOop* p) { do_oop_nv(p); } }; class G1ParScanClosure : public G1ParClosureSuper { public: ! G1ParScanClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state, ReferenceProcessor* rp) : ! G1ParClosureSuper(g1, par_scan_state) ! { assert(_ref_processor == NULL, "sanity"); _ref_processor = rp; } template <class T> void do_oop_nv(T* p); --- 71,82 ---- virtual void do_oop(narrowOop* p) { do_oop_nv(p); } }; class G1ParScanClosure : public G1ParClosureSuper { public: ! G1ParScanClosure(G1CollectedHeap* g1, ReferenceProcessor* rp) : ! G1ParClosureSuper(g1) { assert(_ref_processor == NULL, "sanity"); _ref_processor = rp; } template <class T> void do_oop_nv(T* p);