< prev index next >

src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp

Print this page

165   assert(scan || (!task_entry.is_partial_array_state() && task_entry.to_oop()->is_typeArray()), "Skipping scan of grey non-typeArray");
166   assert(task_entry.is_partial_array_state() || _mark_bitmap->is_marked(cast_from_oop<HeapWord*>(task_entry.to_oop())),
167          "Any stolen object should be a slice or marked");
168 
169   if (scan) {
170     if (task_entry.is_partial_array_state()) {
171       _words_scanned += process_partial_array(task_entry, stolen);
172     } else {
173       oop obj = task_entry.to_oop();
174       if (should_be_sliced(obj)) {
175         _words_scanned += start_partial_array_processing(obj);
176       } else {
177         _words_scanned += obj->oop_iterate_size(_cm_oop_closure);
178       }
179     }
180   }
181   check_limits();
182 }
183 
184 inline bool G1CMTask::should_be_sliced(oop obj) {
185   return obj->is_objArray() && ((objArrayOop)obj)->length() >= (int)ObjArrayMarkingStride;
186 }
187 
188 inline void G1CMTask::process_array_chunk(objArrayOop obj, size_t start, size_t end) {
189   obj->oop_iterate_elements_range(_cm_oop_closure,
190                                   checked_cast<int>(start),
191                                   checked_cast<int>(end));

192 }
193 
194 inline void G1ConcurrentMark::update_top_at_mark_start(G1HeapRegion* r) {
195   uint const region = r->hrm_index();
196   assert(region < _g1h->max_num_regions(), "Tried to access TAMS for region %u out of bounds", region);
197   _top_at_mark_starts[region] = r->top();
198 }
199 
200 inline void G1ConcurrentMark::reset_top_at_mark_start(G1HeapRegion* r) {
201   _top_at_mark_starts[r->hrm_index()] = r->bottom();
202 }
203 
204 inline HeapWord* G1ConcurrentMark::top_at_mark_start(const G1HeapRegion* r) const {
205   return top_at_mark_start(r->hrm_index());
206 }
207 
208 inline HeapWord* G1ConcurrentMark::top_at_mark_start(uint region) const {
209   assert(region < _g1h->max_num_regions(), "Tried to access TARS for region %u out of bounds", region);
210   return _top_at_mark_starts[region];
211 }

165   assert(scan || (!task_entry.is_partial_array_state() && task_entry.to_oop()->is_typeArray()), "Skipping scan of grey non-typeArray");
166   assert(task_entry.is_partial_array_state() || _mark_bitmap->is_marked(cast_from_oop<HeapWord*>(task_entry.to_oop())),
167          "Any stolen object should be a slice or marked");
168 
169   if (scan) {
170     if (task_entry.is_partial_array_state()) {
171       _words_scanned += process_partial_array(task_entry, stolen);
172     } else {
173       oop obj = task_entry.to_oop();
174       if (should_be_sliced(obj)) {
175         _words_scanned += start_partial_array_processing(obj);
176       } else {
177         _words_scanned += obj->oop_iterate_size(_cm_oop_closure);
178       }
179     }
180   }
181   check_limits();
182 }
183 
184 inline bool G1CMTask::should_be_sliced(oop obj) {
185   return obj->is_refArray() && ((refArrayOop)obj)->length() >= (int)ObjArrayMarkingStride;
186 }
187 
188 inline void G1CMTask::process_array_chunk(objArrayOop obj, size_t start, size_t end) {
189   assert(obj->is_refArray(), "Must be");
190   refArrayOop(obj)->oop_iterate_elements_range(_cm_oop_closure,
191                                                checked_cast<int>(start),
192                                                checked_cast<int>(end));
193 }
194 
195 inline void G1ConcurrentMark::update_top_at_mark_start(G1HeapRegion* r) {
196   uint const region = r->hrm_index();
197   assert(region < _g1h->max_num_regions(), "Tried to access TAMS for region %u out of bounds", region);
198   _top_at_mark_starts[region] = r->top();
199 }
200 
201 inline void G1ConcurrentMark::reset_top_at_mark_start(G1HeapRegion* r) {
202   _top_at_mark_starts[r->hrm_index()] = r->bottom();
203 }
204 
205 inline HeapWord* G1ConcurrentMark::top_at_mark_start(const G1HeapRegion* r) const {
206   return top_at_mark_start(r->hrm_index());
207 }
208 
209 inline HeapWord* G1ConcurrentMark::top_at_mark_start(uint region) const {
210   assert(region < _g1h->max_num_regions(), "Tried to access TARS for region %u out of bounds", region);
211   return _top_at_mark_starts[region];
212 }
< prev index next >