Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1OopClosures.hpp @ 20225:cd43876f692e
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
author | tschatzl |
---|---|
date | Mon, 21 Jul 2014 09:41:06 +0200 |
parents | 8847586c9037 |
children | 2c6ef90f030a |
comparison
equal
deleted
inserted
replaced
20224:a2328cbebb23 | 20225:cd43876f692e |
---|---|
49 protected: | 49 protected: |
50 G1CollectedHeap* _g1; | 50 G1CollectedHeap* _g1; |
51 G1ParScanThreadState* _par_scan_state; | 51 G1ParScanThreadState* _par_scan_state; |
52 uint _worker_id; | 52 uint _worker_id; |
53 public: | 53 public: |
54 // Initializes the instance, leaving _par_scan_state uninitialized. Must be done | |
55 // later using the set_par_scan_thread_state() method. | |
56 G1ParClosureSuper(G1CollectedHeap* g1); | |
54 G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state); | 57 G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state); |
55 bool apply_to_weak_ref_discovered_field() { return true; } | 58 bool apply_to_weak_ref_discovered_field() { return true; } |
59 | |
60 void set_par_scan_thread_state(G1ParScanThreadState* par_scan_state); | |
56 }; | 61 }; |
57 | 62 |
58 class G1ParPushHeapRSClosure : public G1ParClosureSuper { | 63 class G1ParPushHeapRSClosure : public G1ParClosureSuper { |
59 public: | 64 public: |
60 G1ParPushHeapRSClosure(G1CollectedHeap* g1, | 65 G1ParPushHeapRSClosure(G1CollectedHeap* g1, |
66 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } | 71 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } |
67 }; | 72 }; |
68 | 73 |
69 class G1ParScanClosure : public G1ParClosureSuper { | 74 class G1ParScanClosure : public G1ParClosureSuper { |
70 public: | 75 public: |
71 G1ParScanClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state, ReferenceProcessor* rp) : | 76 G1ParScanClosure(G1CollectedHeap* g1, ReferenceProcessor* rp) : |
72 G1ParClosureSuper(g1, par_scan_state) | 77 G1ParClosureSuper(g1) { |
73 { | |
74 assert(_ref_processor == NULL, "sanity"); | 78 assert(_ref_processor == NULL, "sanity"); |
75 _ref_processor = rp; | 79 _ref_processor = rp; |
76 } | 80 } |
77 | 81 |
78 template <class T> void do_oop_nv(T* p); | 82 template <class T> void do_oop_nv(T* p); |