hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp
changeset 46646 5165b3a5b44a
parent 46572 fef0d64b2263
child 46670 55a3c36b64b2
--- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp	Fri Jul 07 23:53:36 2017 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp	Mon Jul 10 10:10:49 2017 +0200
@@ -78,8 +78,10 @@
   if (state.is_in_cset()) {
     prefetch_and_push(p, obj);
   } 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);
   }
 }
@@ -171,9 +173,7 @@
     if (_from == to) {
       return;
     }
-
     handle_non_cset_obj_common(state, p, obj);
-
     to->rem_set()->add_reference(p, _worker_i);
   }
 }
@@ -190,6 +190,9 @@
   if (state.is_in_cset()) {
     prefetch_and_push(p, obj);
   } else {
+    if (HeapRegion::is_in_same_region(p, obj)) {
+      return;
+    }
     handle_non_cset_obj_common(state, p, obj);
   }
 }