46 G1CollectedHeap* _g1h;
47 RefToScanQueue* _refs;
48 DirtyCardQueue _dcq;
49 G1CardTable* _ct;
50 G1EvacuationRootClosures* _closures;
51
52 G1PLABAllocator* _plab_allocator;
53
54 AgeTable _age_table;
55 InCSetState _dest[InCSetState::Num];
56 // Local tenuring threshold.
57 uint _tenuring_threshold;
58 G1ScanEvacuatedObjClosure _scanner;
59
60 int _hash_seed;
61 uint _worker_id;
62
63 // Upper and lower threshold to start and end work queue draining.
64 uint const _stack_drain_upper_threshold;
65 uint const _stack_drain_lower_threshold;
66 // Map from young-age-index (0 == not young, 1 is youngest) to
67 // surviving words. base is what we get back from the malloc call
68 size_t* _surviving_young_words_base;
69 // this points into the array, as we use the first few entries for padding
70 size_t* _surviving_young_words;
71
72 // Indicates whether in the last generation (old) there is no more space
73 // available for allocation.
74 bool _old_gen_is_full;
75
76 #define PADDING_ELEM_NUM (DEFAULT_CACHE_LINE_SIZE / sizeof(size_t))
77
78 DirtyCardQueue& dirty_card_queue() { return _dcq; }
79 G1CardTable* ct() { return _ct; }
80
81 InCSetState dest(InCSetState original) const {
82 assert(original.is_valid(),
83 "Original state invalid: " CSETSTATE_FORMAT, original.value());
84 assert(_dest[original.value()].is_valid_gen(),
85 "Dest state is invalid: " CSETSTATE_FORMAT, _dest[original.value()].value());
180 // generations or just end trying to allocate.
181 HeapWord* allocate_in_next_plab(InCSetState const state,
182 InCSetState* dest,
183 size_t word_sz,
184 bool previous_plab_refill_failed);
185
186 inline InCSetState next_state(InCSetState const state, markOop const m, uint& age);
187
188 void report_promotion_event(InCSetState const dest_state,
189 oop const old, size_t word_sz, uint age,
190 HeapWord * const obj_ptr) const;
191
192 inline bool should_start_trim_queue_partially() const;
193 inline bool should_end_trim_queue_partially() const;
194
195 inline void trim_queue_partially_internal();
196 public:
197 oop copy_to_survivor_space(InCSetState const state, oop const obj, markOop const old_mark);
198
199 void trim_queue();
200 Tickspan trim_queue_partially();
201
202 inline void steal_and_trim_queue(RefToScanQueueSet *task_queues);
203
204 // An attempt to evacuate "obj" has failed; take necessary steps.
205 oop handle_evacuation_failure_par(oop obj, markOop m);
206 };
207
208 class G1ParScanThreadStateSet : public StackObj {
209 G1CollectedHeap* _g1h;
210 G1ParScanThreadState** _states;
211 size_t* _surviving_young_words_total;
212 size_t _young_cset_length;
213 uint _n_workers;
214 bool _flushed;
215
216 public:
217 G1ParScanThreadStateSet(G1CollectedHeap* g1h, uint n_workers, size_t young_cset_length);
218 ~G1ParScanThreadStateSet();
219
220 void flush();
|
46 G1CollectedHeap* _g1h;
47 RefToScanQueue* _refs;
48 DirtyCardQueue _dcq;
49 G1CardTable* _ct;
50 G1EvacuationRootClosures* _closures;
51
52 G1PLABAllocator* _plab_allocator;
53
54 AgeTable _age_table;
55 InCSetState _dest[InCSetState::Num];
56 // Local tenuring threshold.
57 uint _tenuring_threshold;
58 G1ScanEvacuatedObjClosure _scanner;
59
60 int _hash_seed;
61 uint _worker_id;
62
63 // Upper and lower threshold to start and end work queue draining.
64 uint const _stack_drain_upper_threshold;
65 uint const _stack_drain_lower_threshold;
66
67 Tickspan _trim_ticks;
68 // Map from young-age-index (0 == not young, 1 is youngest) to
69 // surviving words. base is what we get back from the malloc call
70 size_t* _surviving_young_words_base;
71 // this points into the array, as we use the first few entries for padding
72 size_t* _surviving_young_words;
73
74 // Indicates whether in the last generation (old) there is no more space
75 // available for allocation.
76 bool _old_gen_is_full;
77
78 #define PADDING_ELEM_NUM (DEFAULT_CACHE_LINE_SIZE / sizeof(size_t))
79
80 DirtyCardQueue& dirty_card_queue() { return _dcq; }
81 G1CardTable* ct() { return _ct; }
82
83 InCSetState dest(InCSetState original) const {
84 assert(original.is_valid(),
85 "Original state invalid: " CSETSTATE_FORMAT, original.value());
86 assert(_dest[original.value()].is_valid_gen(),
87 "Dest state is invalid: " CSETSTATE_FORMAT, _dest[original.value()].value());
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();
|