51 public: |
51 public: |
52 G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state); |
52 G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state); |
53 bool apply_to_weak_ref_discovered_field() { return true; } |
53 bool apply_to_weak_ref_discovered_field() { return true; } |
54 }; |
54 }; |
55 |
55 |
|
56 class G1ParPushHeapRSClosure : public G1ParClosureSuper { |
|
57 public: |
|
58 G1ParPushHeapRSClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : |
|
59 G1ParClosureSuper(g1, par_scan_state) { } |
|
60 template <class T> void do_oop_nv(T* p); |
|
61 virtual void do_oop(oop* p) { do_oop_nv(p); } |
|
62 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } |
|
63 }; |
|
64 |
56 class G1ParScanClosure : public G1ParClosureSuper { |
65 class G1ParScanClosure : public G1ParClosureSuper { |
57 public: |
66 public: |
58 G1ParScanClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : |
67 G1ParScanClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : |
59 G1ParClosureSuper(g1, par_scan_state) { } |
68 G1ParClosureSuper(g1, par_scan_state) { } |
60 template <class T> void do_oop_nv(T* p); |
69 template <class T> void do_oop_nv(T* p); |
98 G1ParScanClosure *scanner) : |
107 G1ParScanClosure *scanner) : |
99 G1ParClosureSuper(g1, par_scan_state), _scanner(scanner) { } |
108 G1ParClosureSuper(g1, par_scan_state), _scanner(scanner) { } |
100 }; |
109 }; |
101 |
110 |
102 template<bool do_gen_barrier, G1Barrier barrier, |
111 template<bool do_gen_barrier, G1Barrier barrier, |
103 bool do_mark_forwardee, bool skip_cset_test> |
112 bool do_mark_forwardee> |
104 class G1ParCopyClosure : public G1ParCopyHelper { |
113 class G1ParCopyClosure : public G1ParCopyHelper { |
105 G1ParScanClosure _scanner; |
114 G1ParScanClosure _scanner; |
106 template <class T> void do_oop_work(T* p); |
115 template <class T> void do_oop_work(T* p); |
107 public: |
116 public: |
108 G1ParCopyClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : |
117 G1ParCopyClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : |
114 } |
123 } |
115 virtual void do_oop(oop* p) { do_oop_nv(p); } |
124 virtual void do_oop(oop* p) { do_oop_nv(p); } |
116 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } |
125 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } |
117 }; |
126 }; |
118 |
127 |
119 typedef G1ParCopyClosure<false, G1BarrierNone, false, false> G1ParScanExtRootClosure; |
128 typedef G1ParCopyClosure<false, G1BarrierNone, false> G1ParScanExtRootClosure; |
120 typedef G1ParCopyClosure<true, G1BarrierNone, false, false> G1ParScanPermClosure; |
129 typedef G1ParCopyClosure<true, G1BarrierNone, false> G1ParScanPermClosure; |
121 typedef G1ParCopyClosure<false, G1BarrierRS, false, false> G1ParScanHeapRSClosure; |
130 typedef G1ParCopyClosure<false, G1BarrierRS, false> G1ParScanHeapRSClosure; |
122 typedef G1ParCopyClosure<false, G1BarrierNone, true, false> G1ParScanAndMarkExtRootClosure; |
131 typedef G1ParCopyClosure<false, G1BarrierNone, true> G1ParScanAndMarkExtRootClosure; |
123 typedef G1ParCopyClosure<true, G1BarrierNone, true, false> G1ParScanAndMarkPermClosure; |
132 typedef G1ParCopyClosure<true, G1BarrierNone, true> G1ParScanAndMarkPermClosure; |
124 typedef G1ParCopyClosure<false, G1BarrierRS, true, false> G1ParScanAndMarkHeapRSClosure; |
133 typedef G1ParCopyClosure<false, G1BarrierRS, true> G1ParScanAndMarkHeapRSClosure; |
|
134 |
125 // This is the only case when we set skip_cset_test. Basically, this |
135 // This is the only case when we set skip_cset_test. Basically, this |
126 // closure is (should?) only be called directly while we're draining |
136 // closure is (should?) only be called directly while we're draining |
127 // the overflow and task queues. In that case we know that the |
137 // the overflow and task queues. In that case we know that the |
128 // reference in question points into the collection set, otherwise we |
138 // reference in question points into the collection set, otherwise we |
129 // would not have pushed it on the queue. The following is defined in |
139 // would not have pushed it on the queue. The following is defined in |
130 // g1_specialized_oop_closures.hpp. |
140 // g1_specialized_oop_closures.hpp. |
131 // typedef G1ParCopyClosure<false, G1BarrierEvac, false, true> G1ParScanHeapEvacClosure; |
141 // typedef G1ParCopyClosure<false, G1BarrierEvac, false, true> G1ParScanHeapEvacClosure; |
132 // We need a separate closure to handle references during evacuation |
142 // We need a separate closure to handle references during evacuation |
133 // failure processing, as we cannot asume that the reference already |
143 // failure processing, as we cannot asume that the reference already |
134 // points into the collection set (like G1ParScanHeapEvacClosure does). |
144 // points into the collection set (like G1ParScanHeapEvacClosure does). |
135 typedef G1ParCopyClosure<false, G1BarrierEvac, false, false> G1ParScanHeapEvacFailureClosure; |
145 typedef G1ParCopyClosure<false, G1BarrierEvac, false> G1ParScanHeapEvacFailureClosure; |
136 |
146 |
137 class FilterIntoCSClosure: public OopClosure { |
147 class FilterIntoCSClosure: public OopClosure { |
138 G1CollectedHeap* _g1; |
148 G1CollectedHeap* _g1; |
139 OopClosure* _oc; |
149 OopClosure* _oc; |
140 DirtyCardToOopClosure* _dcto_cl; |
150 DirtyCardToOopClosure* _dcto_cl; |