< prev index next >

src/share/vm/gc/g1/g1OopClosures.inline.hpp

Print this page




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




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


< prev index next >