174 inline void dispatch_reference(StarTask ref);
175
176 // Tries to allocate word_sz in the PLAB of the next "generation" after trying to
177 // allocate into dest. State is the original (source) cset state for the object
178 // that is allocated for. Previous_plab_refill_failed indicates whether previously
179 // a PLAB refill into "state" failed.
180 // Returns a non-NULL pointer if successful, and updates dest if required.
181 // Also determines whether we should continue to try to allocate into the various
182 // generations or just end trying to allocate.
183 HeapWord* allocate_in_next_plab(InCSetState const state,
184 InCSetState* dest,
185 size_t word_sz,
186 bool previous_plab_refill_failed);
187
188 inline InCSetState next_state(InCSetState const state, markOop const m, uint& age);
189
190 void report_promotion_event(InCSetState const dest_state,
191 oop const old, size_t word_sz, uint age,
192 HeapWord * const obj_ptr) const;
193
194 inline bool should_start_trim_queue_partially() const;
195 inline bool should_end_trim_queue_partially() const;
196
197 inline void trim_queue_partially_internal();
198 public:
199 oop copy_to_survivor_space(InCSetState const state, oop const obj, markOop const old_mark);
200
201 void trim_queue();
202 void trim_queue_partially();
203
204 Tickspan trim_ticks_and_reset();
205
206 inline void steal_and_trim_queue(RefToScanQueueSet *task_queues);
207
208 // An attempt to evacuate "obj" has failed; take necessary steps.
209 oop handle_evacuation_failure_par(oop obj, markOop m);
210 };
211
212 class G1ParScanThreadStateSet : public StackObj {
213 G1CollectedHeap* _g1h;
214 G1ParScanThreadState** _states;
215 size_t* _surviving_young_words_total;
216 size_t _young_cset_length;
217 uint _n_workers;
218 bool _flushed;
219
220 public:
221 G1ParScanThreadStateSet(G1CollectedHeap* g1h, uint n_workers, size_t young_cset_length);
222 ~G1ParScanThreadStateSet();
223
224 void flush();
|
174 inline void dispatch_reference(StarTask ref);
175
176 // Tries to allocate word_sz in the PLAB of the next "generation" after trying to
177 // allocate into dest. State is the original (source) cset state for the object
178 // that is allocated for. Previous_plab_refill_failed indicates whether previously
179 // a PLAB refill into "state" failed.
180 // Returns a non-NULL pointer if successful, and updates dest if required.
181 // Also determines whether we should continue to try to allocate into the various
182 // generations or just end trying to allocate.
183 HeapWord* allocate_in_next_plab(InCSetState const state,
184 InCSetState* dest,
185 size_t word_sz,
186 bool previous_plab_refill_failed);
187
188 inline InCSetState next_state(InCSetState const state, markOop const m, uint& age);
189
190 void report_promotion_event(InCSetState const dest_state,
191 oop const old, size_t word_sz, uint age,
192 HeapWord * const obj_ptr) const;
193
194 inline bool needs_partial_trimming() const;
195 inline bool is_partially_trimmed() const;
196
197 inline void trim_queue_to_threshold(uint threshold);
198 public:
199 oop copy_to_survivor_space(InCSetState const state, oop const obj, markOop const old_mark);
200
201 void trim_queue();
202 void trim_queue_partially();
203
204 Tickspan trim_ticks();
205 void reset_trim_ticks();
206
207 inline void steal_and_trim_queue(RefToScanQueueSet *task_queues);
208
209 // An attempt to evacuate "obj" has failed; take necessary steps.
210 oop handle_evacuation_failure_par(oop obj, markOop m);
211 };
212
213 class G1ParScanThreadStateSet : public StackObj {
214 G1CollectedHeap* _g1h;
215 G1ParScanThreadState** _states;
216 size_t* _surviving_young_words_total;
217 size_t _young_cset_length;
218 uint _n_workers;
219 bool _flushed;
220
221 public:
222 G1ParScanThreadStateSet(G1CollectedHeap* g1h, uint n_workers, size_t young_cset_length);
223 ~G1ParScanThreadStateSet();
224
225 void flush();
|