8207953: Remove dead code in G1CopyingKeepAliveClosure
authortschatzl
Mon, 23 Jul 2018 17:32:04 +0200
changeset 51183 bd2e3c3b4547
parent 51182 b0fcf59be391
child 51184 1edc62f9ba3a
8207953: Remove dead code in G1CopyingKeepAliveClosure Reviewed-by: kbarrett
src/hotspot/share/gc/g1/g1CollectedHeap.cpp
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Fri Jul 20 14:48:41 2018 -0700
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Mon Jul 23 17:32:04 2018 +0200
@@ -3716,15 +3716,12 @@
 
 class G1CopyingKeepAliveClosure: public OopClosure {
   G1CollectedHeap*         _g1h;
-  OopClosure*              _copy_non_heap_obj_cl;
   G1ParScanThreadState*    _par_scan_state;
 
 public:
   G1CopyingKeepAliveClosure(G1CollectedHeap* g1h,
-                            OopClosure* non_heap_obj_cl,
                             G1ParScanThreadState* pss):
     _g1h(g1h),
-    _copy_non_heap_obj_cl(non_heap_obj_cl),
     _par_scan_state(pss)
   {}
 
@@ -3744,22 +3741,10 @@
       // If the referent has not been forwarded then we have to keep
       // it alive by policy. Therefore we have copy the referent.
       //
-      // If the reference field is in the G1 heap then we can push
-      // on the PSS queue. When the queue is drained (after each
-      // phase of reference processing) the object and it's followers
-      // will be copied, the reference field set to point to the
-      // new location, and the RSet updated. Otherwise we need to
-      // use the the non-heap or metadata closures directly to copy
-      // the referent object and update the pointer, while avoiding
-      // updating the RSet.
-
-      if (_g1h->is_in_g1_reserved(p)) {
-        _par_scan_state->push_on_queue(p);
-      } else {
-        assert(!Metaspace::contains((const void*)p),
-               "Unexpectedly found a pointer from metadata: " PTR_FORMAT, p2i(p));
-        _copy_non_heap_obj_cl->do_oop(p);
-      }
+      // When the queue is drained (after each phase of reference processing)
+      // the object and it's followers will be copied, the reference field set
+      // to point to the new location, and the RSet updated.
+      _par_scan_state->push_on_queue(p);
     }
   }
 };
@@ -3851,7 +3836,7 @@
     pss->set_ref_discoverer(NULL);
 
     // Keep alive closure.
-    G1CopyingKeepAliveClosure keep_alive(_g1h, pss->closures()->raw_strong_oops(), pss);
+    G1CopyingKeepAliveClosure keep_alive(_g1h, pss);
 
     // Complete GC closure
     G1ParEvacuateFollowersClosure drain_queue(_g1h, pss, _task_queues, _terminator);
@@ -3903,7 +3888,7 @@
   assert(pss->queue_is_empty(), "pre-condition");
 
   // Keep alive closure.
-  G1CopyingKeepAliveClosure keep_alive(this, pss->closures()->raw_strong_oops(), pss);
+  G1CopyingKeepAliveClosure keep_alive(this, pss);
 
   // Serial Complete GC closure
   G1STWDrainQueueClosure drain_queue(this, pss);