comparison src/share/vm/gc_implementation/g1/g1OopClosures.hpp @ 5987:748051fd24ce

7130974: G1: Remove G1ParCopyHelper Reviewed-by: tonyp, johnc
author brutisso
date Fri, 16 Mar 2012 09:52:57 +0100
parents b4ebad3520bb
children a2f7274eb6ef
comparison
equal deleted inserted replaced
5986:500023bd0818 5987:748051fd24ce
116 template <class T> void do_oop_nv(T* p); 116 template <class T> void do_oop_nv(T* p);
117 virtual void do_oop(oop* p) { do_oop_nv(p); } 117 virtual void do_oop(oop* p) { do_oop_nv(p); }
118 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } 118 virtual void do_oop(narrowOop* p) { do_oop_nv(p); }
119 }; 119 };
120 120
121 121 template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object>
122 class G1ParCopyHelper : public G1ParClosureSuper { 122 class G1ParCopyClosure : public G1ParClosureSuper {
123 G1ParScanClosure *_scanner; 123 G1ParScanClosure _scanner;
124 template <class T> void do_oop_work(T* p);
125
124 protected: 126 protected:
125 // Mark the object if it's not already marked. This is used to mark 127 // Mark the object if it's not already marked. This is used to mark
126 // objects pointed to by roots that are guaranteed not to move 128 // objects pointed to by roots that are guaranteed not to move
127 // during the GC (i.e., non-CSet objects). It is MT-safe. 129 // during the GC (i.e., non-CSet objects). It is MT-safe.
128 void mark_object(oop obj); 130 void mark_object(oop obj);
133 void mark_forwarded_object(oop from_obj, oop to_obj); 135 void mark_forwarded_object(oop from_obj, oop to_obj);
134 136
135 oop copy_to_survivor_space(oop obj); 137 oop copy_to_survivor_space(oop obj);
136 138
137 public: 139 public:
138 G1ParCopyHelper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state,
139 G1ParScanClosure *scanner) :
140 G1ParClosureSuper(g1, par_scan_state), _scanner(scanner) { }
141 };
142
143 template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object>
144 class G1ParCopyClosure : public G1ParCopyHelper {
145 G1ParScanClosure _scanner;
146
147 template <class T> void do_oop_work(T* p);
148
149 public:
150 G1ParCopyClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state, 140 G1ParCopyClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state,
151 ReferenceProcessor* rp) : 141 ReferenceProcessor* rp) :
152 _scanner(g1, par_scan_state, rp), 142 _scanner(g1, par_scan_state, rp),
153 G1ParCopyHelper(g1, par_scan_state, &_scanner) { 143 G1ParClosureSuper(g1, par_scan_state) {
154 assert(_ref_processor == NULL, "sanity"); 144 assert(_ref_processor == NULL, "sanity");
155 } 145 }
156 146
157 G1ParScanClosure* scanner() { return &_scanner; } 147 G1ParScanClosure* scanner() { return &_scanner; }
158 148