210 _push_ref_cl->do_oop(p);
211 }
212
213 // Deferred updates to the CSet are either discarded (in the normal case),
214 // or processed (if an evacuation failure occurs) at the end
215 // of the collection.
216 // See G1RemSet::cleanup_after_oops_into_collection_set_do().
217 } else {
218 // We either don't care about pushing references that point into the
219 // collection set (i.e. we're not during an evacuation pause) _or_
220 // the reference doesn't point into the collection set. Either way
221 // we add the reference directly to the RSet of the region containing
222 // the referenced object.
223 assert(to->rem_set() != NULL, "Need per-region 'into' remsets.");
224 to->rem_set()->add_reference(p, _worker_i);
225 }
226 }
227
228 template <class T>
229 void G1ParCopyHelper::do_klass_barrier(T* p, oop new_obj) {
230 if (_g1->heap_region_containing_raw(new_obj)->is_young()) {
231 _scanned_klass->record_modified_oops();
232 }
233 }
234
235 void G1ParCopyHelper::mark_object(oop obj) {
236 assert(!_g1->heap_region_containing(obj)->in_collection_set(), "should not mark objects in the CSet");
237
238 // We know that the object is not moving so it's safe to read its size.
239 _cm->grayRoot(obj, (size_t) obj->size(), _worker_id);
240 }
241
242 void G1ParCopyHelper::mark_forwarded_object(oop from_obj, oop to_obj) {
243 assert(from_obj->is_forwarded(), "from obj should be forwarded");
244 assert(from_obj->forwardee() == to_obj, "to obj should be the forwardee");
245 assert(from_obj != to_obj, "should not be self-forwarded");
246
247 assert(_g1->heap_region_containing(from_obj)->in_collection_set(), "from obj should be in the CSet");
248 assert(!_g1->heap_region_containing(to_obj)->in_collection_set(), "should not mark objects in the CSet");
249
250 // The object might be in the process of being copied by another
|
210 _push_ref_cl->do_oop(p);
211 }
212
213 // Deferred updates to the CSet are either discarded (in the normal case),
214 // or processed (if an evacuation failure occurs) at the end
215 // of the collection.
216 // See G1RemSet::cleanup_after_oops_into_collection_set_do().
217 } else {
218 // We either don't care about pushing references that point into the
219 // collection set (i.e. we're not during an evacuation pause) _or_
220 // the reference doesn't point into the collection set. Either way
221 // we add the reference directly to the RSet of the region containing
222 // the referenced object.
223 assert(to->rem_set() != NULL, "Need per-region 'into' remsets.");
224 to->rem_set()->add_reference(p, _worker_i);
225 }
226 }
227
228 template <class T>
229 void G1ParCopyHelper::do_klass_barrier(T* p, oop new_obj) {
230 if (_g1->heap_region_containing(new_obj)->is_young()) {
231 _scanned_klass->record_modified_oops();
232 }
233 }
234
235 void G1ParCopyHelper::mark_object(oop obj) {
236 assert(!_g1->heap_region_containing(obj)->in_collection_set(), "should not mark objects in the CSet");
237
238 // We know that the object is not moving so it's safe to read its size.
239 _cm->grayRoot(obj, (size_t) obj->size(), _worker_id);
240 }
241
242 void G1ParCopyHelper::mark_forwarded_object(oop from_obj, oop to_obj) {
243 assert(from_obj->is_forwarded(), "from obj should be forwarded");
244 assert(from_obj->forwardee() == to_obj, "to obj should be the forwardee");
245 assert(from_obj != to_obj, "should not be self-forwarded");
246
247 assert(_g1->heap_region_containing(from_obj)->in_collection_set(), "from obj should be in the CSet");
248 assert(!_g1->heap_region_containing(to_obj)->in_collection_set(), "should not mark objects in the CSet");
249
250 // The object might be in the process of being copied by another
|