< prev index next >

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

Print this page
rev 52281 : [mq]: 8212911-unify-reference-handling-during-gc

@@ -85,11 +85,14 @@
   } else {
     if (HeapRegion::is_in_same_region(p, obj)) {
       return;
     }
     handle_non_cset_obj_common(state, p, obj);
-    _par_scan_state->update_rs(_from, p, obj);
+    if (_from_is_young) {
+      return;
+    }
+    _par_scan_state->enqueue_card_if_tracked(p, obj);
   }
 }
 
 template <class T>
 inline void G1CMOopClosure::do_oop_work(T* p) {

@@ -171,16 +174,16 @@
   if (state.is_in_cset()) {
     // Since the source is always from outside the collection set, here we implicitly know
     // that this is a cross-region reference too.
     prefetch_and_push(p, obj);
   } else {
-    HeapRegion* to = _g1h->heap_region_containing(obj);
-    if (_from == to) {
+    if (HeapRegion::is_in_same_region(p, obj)) {
       return;
     }
     handle_non_cset_obj_common(state, p, obj);
-    to->rem_set()->add_reference(p, _worker_i);
+    assert(!_from_is_young, "Should not be the case.");
+    _par_scan_state->enqueue_card_if_tracked(p, obj);
   }
 }
 
 template <class T>
 inline void G1ScanObjsDuringScanRSClosure::do_oop_work(T* p) {
< prev index next >