22 *
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
27
28 #include "gc_implementation/parNew/parOopClosures.hpp"
29 #include "gc_implementation/shared/gcTrace.hpp"
30 #include "gc_implementation/shared/plab.hpp"
31 #include "gc_implementation/shared/copyFailedInfo.hpp"
32 #include "memory/defNewGeneration.hpp"
33 #include "memory/padded.hpp"
34 #include "utilities/taskqueue.hpp"
35
36 class ChunkArray;
37 class ParScanWithoutBarrierClosure;
38 class ParScanWithBarrierClosure;
39 class ParRootScanWithoutBarrierClosure;
40 class ParRootScanWithBarrierTwoGensClosure;
41 class ParEvacuateFollowersClosure;
42
43 // It would be better if these types could be kept local to the .cpp file,
44 // but they must be here to allow ParScanClosure::do_oop_work to be defined
45 // in genOopClosures.inline.hpp.
46
47 typedef Padded<OopTaskQueue> ObjToScanQueue;
48 typedef GenericTaskQueueSet<ObjToScanQueue, mtGC> ObjToScanQueueSet;
49
50 class ParKeepAliveClosure: public DefNewGeneration::KeepAliveClosure {
51 private:
52 ParScanWeakRefClosure* _par_cl;
53 protected:
54 template <class T> void do_oop_work(T* p);
55 public:
56 ParKeepAliveClosure(ParScanWeakRefClosure* cl);
57 virtual void do_oop(oop* p);
58 virtual void do_oop(narrowOop* p);
59 };
60
61 // The state needed by thread performing parallel young-gen collection.
220 void start_term_time() {
221 TASKQUEUE_STATS_ONLY(note_term_attempt());
222 _start_term = os::elapsedTime();
223 }
224 void end_term_time() {
225 _term_time += (os::elapsedTime() - _start_term);
226 }
227 double term_time() const { return _term_time; }
228
229 double elapsed_time() const {
230 return os::elapsedTime() - _start;
231 }
232 };
233
234 class ParNewGenTask: public AbstractGangTask {
235 private:
236 ParNewGeneration* _gen;
237 Generation* _old_gen;
238 HeapWord* _young_old_boundary;
239 class ParScanThreadStateSet* _state_set;
240
241 public:
242 ParNewGenTask(ParNewGeneration* gen,
243 Generation* old_gen,
244 HeapWord* young_old_boundary,
245 ParScanThreadStateSet* state_set);
246
247 HeapWord* young_old_boundary() { return _young_old_boundary; }
248
249 void work(uint worker_id);
250
251 // Reset the terminator in ParScanThreadStateSet for
252 // "active_workers" threads.
253 virtual void set_for_termination(uint active_workers);
254 };
255
256 class KeepAliveClosure: public DefNewGeneration::KeepAliveClosure {
257 protected:
258 template <class T> void do_oop_work(T* p);
259 public:
260 KeepAliveClosure(ScanWeakRefClosure* cl);
261 virtual void do_oop(oop* p);
262 virtual void do_oop(narrowOop* p);
263 };
264
265 class EvacuateFollowersClosureGeneral: public VoidClosure {
|
22 *
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
27
28 #include "gc_implementation/parNew/parOopClosures.hpp"
29 #include "gc_implementation/shared/gcTrace.hpp"
30 #include "gc_implementation/shared/plab.hpp"
31 #include "gc_implementation/shared/copyFailedInfo.hpp"
32 #include "memory/defNewGeneration.hpp"
33 #include "memory/padded.hpp"
34 #include "utilities/taskqueue.hpp"
35
36 class ChunkArray;
37 class ParScanWithoutBarrierClosure;
38 class ParScanWithBarrierClosure;
39 class ParRootScanWithoutBarrierClosure;
40 class ParRootScanWithBarrierTwoGensClosure;
41 class ParEvacuateFollowersClosure;
42 class StrongRootsScope;
43
44 // It would be better if these types could be kept local to the .cpp file,
45 // but they must be here to allow ParScanClosure::do_oop_work to be defined
46 // in genOopClosures.inline.hpp.
47
48 typedef Padded<OopTaskQueue> ObjToScanQueue;
49 typedef GenericTaskQueueSet<ObjToScanQueue, mtGC> ObjToScanQueueSet;
50
51 class ParKeepAliveClosure: public DefNewGeneration::KeepAliveClosure {
52 private:
53 ParScanWeakRefClosure* _par_cl;
54 protected:
55 template <class T> void do_oop_work(T* p);
56 public:
57 ParKeepAliveClosure(ParScanWeakRefClosure* cl);
58 virtual void do_oop(oop* p);
59 virtual void do_oop(narrowOop* p);
60 };
61
62 // The state needed by thread performing parallel young-gen collection.
221 void start_term_time() {
222 TASKQUEUE_STATS_ONLY(note_term_attempt());
223 _start_term = os::elapsedTime();
224 }
225 void end_term_time() {
226 _term_time += (os::elapsedTime() - _start_term);
227 }
228 double term_time() const { return _term_time; }
229
230 double elapsed_time() const {
231 return os::elapsedTime() - _start;
232 }
233 };
234
235 class ParNewGenTask: public AbstractGangTask {
236 private:
237 ParNewGeneration* _gen;
238 Generation* _old_gen;
239 HeapWord* _young_old_boundary;
240 class ParScanThreadStateSet* _state_set;
241 StrongRootsScope* _strong_roots_scope;
242
243 public:
244 ParNewGenTask(ParNewGeneration* gen,
245 Generation* old_gen,
246 HeapWord* young_old_boundary,
247 ParScanThreadStateSet* state_set,
248 StrongRootsScope* strong_roots_scope);
249
250 HeapWord* young_old_boundary() { return _young_old_boundary; }
251
252 void work(uint worker_id);
253
254 // Reset the terminator in ParScanThreadStateSet for
255 // "active_workers" threads.
256 virtual void set_for_termination(uint active_workers);
257 };
258
259 class KeepAliveClosure: public DefNewGeneration::KeepAliveClosure {
260 protected:
261 template <class T> void do_oop_work(T* p);
262 public:
263 KeepAliveClosure(ScanWeakRefClosure* cl);
264 virtual void do_oop(oop* p);
265 virtual void do_oop(narrowOop* p);
266 };
267
268 class EvacuateFollowersClosureGeneral: public VoidClosure {
|