4099 OopAndMarkOop elem(obj, m); |
4099 OopAndMarkOop elem(obj, m); |
4100 _preserved_objs[worker_id].push(elem); |
4100 _preserved_objs[worker_id].push(elem); |
4101 } |
4101 } |
4102 } |
4102 } |
4103 |
4103 |
4104 class G1ParEvacuateFollowersClosure : public VoidClosure { |
|
4105 private: |
|
4106 double _start_term; |
|
4107 double _term_time; |
|
4108 size_t _term_attempts; |
|
4109 |
|
4110 void start_term_time() { _term_attempts++; _start_term = os::elapsedTime(); } |
|
4111 void end_term_time() { _term_time += os::elapsedTime() - _start_term; } |
|
4112 protected: |
|
4113 G1CollectedHeap* _g1h; |
|
4114 G1ParScanThreadState* _par_scan_state; |
|
4115 RefToScanQueueSet* _queues; |
|
4116 ParallelTaskTerminator* _terminator; |
|
4117 |
|
4118 G1ParScanThreadState* par_scan_state() { return _par_scan_state; } |
|
4119 RefToScanQueueSet* queues() { return _queues; } |
|
4120 ParallelTaskTerminator* terminator() { return _terminator; } |
|
4121 |
|
4122 public: |
|
4123 G1ParEvacuateFollowersClosure(G1CollectedHeap* g1h, |
|
4124 G1ParScanThreadState* par_scan_state, |
|
4125 RefToScanQueueSet* queues, |
|
4126 ParallelTaskTerminator* terminator) |
|
4127 : _g1h(g1h), _par_scan_state(par_scan_state), |
|
4128 _queues(queues), _terminator(terminator), |
|
4129 _start_term(0.0), _term_time(0.0), _term_attempts(0) {} |
|
4130 |
|
4131 void do_void(); |
|
4132 |
|
4133 double term_time() const { return _term_time; } |
|
4134 size_t term_attempts() const { return _term_attempts; } |
|
4135 |
|
4136 private: |
|
4137 inline bool offer_termination(); |
|
4138 }; |
|
4139 |
|
4140 bool G1ParEvacuateFollowersClosure::offer_termination() { |
4104 bool G1ParEvacuateFollowersClosure::offer_termination() { |
4141 G1ParScanThreadState* const pss = par_scan_state(); |
4105 G1ParScanThreadState* const pss = par_scan_state(); |
4142 start_term_time(); |
4106 start_term_time(); |
4143 const bool res = terminator()->offer_termination(); |
4107 const bool res = terminator()->offer_termination(); |
4144 end_term_time(); |
4108 end_term_time(); |