8202780: Remove EnqueueTask related code from ReferenceProcessor after JDK-8202017 jdk-11+13
authortschatzl
Wed, 09 May 2018 13:37:05 +0200
changeset 50071 758deedaae84
parent 50070 c036b84c6bbf
child 50072 54eda3aad6dd
8202780: Remove EnqueueTask related code from ReferenceProcessor after JDK-8202017 Summary: Remove code obsoleted by JDK-8202017 Reviewed-by: kbarrett, sangheki
src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp
src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp
src/hotspot/share/gc/cms/parNewGeneration.cpp
src/hotspot/share/gc/cms/parNewGeneration.hpp
src/hotspot/share/gc/g1/g1CollectedHeap.cpp
src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
src/hotspot/share/gc/g1/g1FullGCReferenceProcessorExecutor.cpp
src/hotspot/share/gc/g1/g1FullGCReferenceProcessorExecutor.hpp
src/hotspot/share/gc/parallel/pcTasks.cpp
src/hotspot/share/gc/parallel/pcTasks.hpp
src/hotspot/share/gc/parallel/psScavenge.cpp
src/hotspot/share/gc/shared/referenceProcessor.hpp
--- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Wed May 09 11:24:12 2018 +0200
+++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Wed May 09 13:37:05 2018 +0200
@@ -5062,22 +5062,6 @@
   assert(_collector->_overflow_list == NULL, "non-empty _overflow_list");
 }
 
-class CMSRefEnqueueTaskProxy: public AbstractGangTask {
-  typedef AbstractRefProcTaskExecutor::EnqueueTask EnqueueTask;
-  EnqueueTask& _task;
-
-public:
-  CMSRefEnqueueTaskProxy(EnqueueTask& task)
-    : AbstractGangTask("Enqueue reference objects in parallel"),
-      _task(task)
-  { }
-
-  virtual void work(uint worker_id)
-  {
-    _task.work(worker_id);
-  }
-};
-
 CMSParKeepAliveClosure::CMSParKeepAliveClosure(CMSCollector* collector,
   MemRegion span, CMSBitMap* bit_map, OopTaskQueue* work_queue):
    _span(span),
@@ -5147,16 +5131,6 @@
   workers->run_task(&rp_task);
 }
 
-void CMSRefProcTaskExecutor::execute(EnqueueTask& task)
-{
-
-  CMSHeap* heap = CMSHeap::heap();
-  WorkGang* workers = heap->workers();
-  assert(workers != NULL, "Need parallel worker threads.");
-  CMSRefEnqueueTaskProxy enq_task(task);
-  workers->run_task(&enq_task);
-}
-
 void CMSCollector::refProcessingWork() {
   ResourceMark rm;
   HandleMark   hm;
--- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp	Wed May 09 11:24:12 2018 +0200
+++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp	Wed May 09 13:37:05 2018 +0200
@@ -487,7 +487,6 @@
 
   // Executes a task using worker threads.
   virtual void execute(ProcessTask& task);
-  virtual void execute(EnqueueTask& task);
 private:
   CMSCollector& _collector;
 };
--- a/src/hotspot/share/gc/cms/parNewGeneration.cpp	Wed May 09 11:24:12 2018 +0200
+++ b/src/hotspot/share/gc/cms/parNewGeneration.cpp	Wed May 09 13:37:05 2018 +0200
@@ -789,21 +789,6 @@
              par_scan_state.evacuate_followers_closure());
 }
 
-class ParNewRefEnqueueTaskProxy: public AbstractGangTask {
-  typedef AbstractRefProcTaskExecutor::EnqueueTask EnqueueTask;
-  EnqueueTask& _task;
-
-public:
-  ParNewRefEnqueueTaskProxy(EnqueueTask& task)
-    : AbstractGangTask("ParNewGeneration parallel reference enqueue"),
-      _task(task)
-  { }
-
-  virtual void work(uint worker_id) {
-    _task.work(worker_id);
-  }
-};
-
 void ParNewRefProcTaskExecutor::execute(ProcessTask& task) {
   CMSHeap* gch = CMSHeap::heap();
   WorkGang* workers = gch->workers();
@@ -816,14 +801,6 @@
                    _young_gen.promotion_failed());
 }
 
-void ParNewRefProcTaskExecutor::execute(EnqueueTask& task) {
-  CMSHeap* gch = CMSHeap::heap();
-  WorkGang* workers = gch->workers();
-  assert(workers != NULL, "Need parallel worker threads.");
-  ParNewRefEnqueueTaskProxy enq_task(task);
-  workers->run_task(&enq_task);
-}
-
 void ParNewRefProcTaskExecutor::set_single_threaded_mode() {
   _state_set.flush();
   CMSHeap* heap = CMSHeap::heap();
--- a/src/hotspot/share/gc/cms/parNewGeneration.hpp	Wed May 09 11:24:12 2018 +0200
+++ b/src/hotspot/share/gc/cms/parNewGeneration.hpp	Wed May 09 13:37:05 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -297,7 +297,6 @@
 
   // Executes a task using worker threads.
   virtual void execute(ProcessTask& task);
-  virtual void execute(EnqueueTask& task);
   // Switch to single threaded mode.
   virtual void set_single_threaded_mode();
 };
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Wed May 09 11:24:12 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Wed May 09 13:37:05 2018 +0200
@@ -3791,7 +3791,6 @@
 
   // Executes the given task using concurrent marking worker threads.
   virtual void execute(ProcessTask& task);
-  virtual void execute(EnqueueTask& task);
 };
 
 // Gang task for possibly parallel reference processing
@@ -3856,35 +3855,6 @@
   _workers->run_task(&proc_task_proxy);
 }
 
-// Gang task for parallel reference enqueueing.
-
-class G1STWRefEnqueueTaskProxy: public AbstractGangTask {
-  typedef AbstractRefProcTaskExecutor::EnqueueTask EnqueueTask;
-  EnqueueTask& _enq_task;
-
-public:
-  G1STWRefEnqueueTaskProxy(EnqueueTask& enq_task) :
-    AbstractGangTask("Enqueue reference objects in parallel"),
-    _enq_task(enq_task)
-  { }
-
-  virtual void work(uint worker_id) {
-    _enq_task.work(worker_id);
-  }
-};
-
-// Driver routine for parallel reference enqueueing.
-// Creates an instance of the ref enqueueing gang
-// task and has the worker threads execute it.
-
-void G1STWRefProcTaskExecutor::execute(EnqueueTask& enq_task) {
-  assert(_workers != NULL, "Need parallel worker threads.");
-
-  G1STWRefEnqueueTaskProxy enq_task_proxy(enq_task);
-
-  _workers->run_task(&enq_task_proxy);
-}
-
 // End of weak reference support closures
 
 void G1CollectedHeap::process_discovered_references(G1ParScanThreadStateSet* per_thread_states) {
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Wed May 09 11:24:12 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Wed May 09 13:37:05 2018 +0200
@@ -1520,7 +1520,6 @@
 
   // Executes the given task using concurrent marking worker threads.
   virtual void execute(ProcessTask& task);
-  virtual void execute(EnqueueTask& task);
 };
 
 class G1CMRefProcTaskProxy : public AbstractGangTask {
@@ -1565,36 +1564,6 @@
   _workers->run_task(&proc_task_proxy);
 }
 
-class G1CMRefEnqueueTaskProxy : public AbstractGangTask {
-  typedef AbstractRefProcTaskExecutor::EnqueueTask EnqueueTask;
-  EnqueueTask& _enq_task;
-
-public:
-  G1CMRefEnqueueTaskProxy(EnqueueTask& enq_task) :
-    AbstractGangTask("Enqueue reference objects in parallel"),
-    _enq_task(enq_task) { }
-
-  virtual void work(uint worker_id) {
-    _enq_task.work(worker_id);
-  }
-};
-
-void G1CMRefProcTaskExecutor::execute(EnqueueTask& enq_task) {
-  assert(_workers != NULL, "Need parallel worker threads.");
-  assert(_g1h->ref_processor_cm()->processing_is_mt(), "processing is not MT");
-
-  G1CMRefEnqueueTaskProxy enq_task_proxy(enq_task);
-
-  // Not strictly necessary but...
-  //
-  // We need to reset the concurrency level before each
-  // proxy task execution, so that the termination protocol
-  // and overflow handling in G1CMTask::do_marking_step() knows
-  // how many workers to wait for.
-  _cm->set_concurrency(_active_workers);
-  _workers->run_task(&enq_task_proxy);
-}
-
 void G1ConcurrentMark::weak_refs_work(bool clear_all_soft_refs) {
   ResourceMark rm;
   HandleMark   hm;
--- a/src/hotspot/share/gc/g1/g1FullGCReferenceProcessorExecutor.cpp	Wed May 09 11:24:12 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1FullGCReferenceProcessorExecutor.cpp	Wed May 09 13:37:05 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,14 +63,6 @@
                   *marker->stack_closure());
 }
 
-G1FullGCReferenceProcessingExecutor::G1RefEnqueueTaskProxy::G1RefEnqueueTaskProxy(EnqueueTask& enq_task) :
-  AbstractGangTask("G1 reference enqueue task"),
-  _enq_task(enq_task) { }
-
-void G1FullGCReferenceProcessingExecutor::G1RefEnqueueTaskProxy::work(uint worker_id) {
-  _enq_task.work(worker_id);
-}
-
 void G1FullGCReferenceProcessingExecutor::run_task(AbstractGangTask* task) {
   G1CollectedHeap::heap()->workers()->run_task(task, _collector->workers());
 }
@@ -80,12 +72,6 @@
   run_task(&proc_task_proxy);
 }
 
-// Driver routine for parallel reference processing.
-void G1FullGCReferenceProcessingExecutor::execute(EnqueueTask& enq_task) {
-  G1RefEnqueueTaskProxy enq_task_proxy(enq_task);
-  run_task(&enq_task_proxy);
-}
-
 void G1FullGCReferenceProcessingExecutor::execute(STWGCTimer* timer, G1FullGCTracer* tracer) {
   GCTraceTime(Debug, gc, phases) debug("Phase 1: Reference Processing", timer);
   // Process reference objects found during marking.
--- a/src/hotspot/share/gc/g1/g1FullGCReferenceProcessorExecutor.hpp	Wed May 09 11:24:12 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1FullGCReferenceProcessorExecutor.hpp	Wed May 09 13:37:05 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,6 @@
 
   // Executes the given task using concurrent marking worker threads.
   virtual void execute(ProcessTask& task);
-  virtual void execute(EnqueueTask& task);
 
 private:
   void run_task(AbstractGangTask* task);
@@ -68,15 +67,6 @@
 
     virtual void work(uint worker_id);
   };
-
-  class G1RefEnqueueTaskProxy: public AbstractGangTask {
-    typedef AbstractRefProcTaskExecutor::EnqueueTask EnqueueTask;
-    EnqueueTask& _enq_task;
-
-  public:
-    G1RefEnqueueTaskProxy(EnqueueTask& enq_task);
-    virtual void work(uint worker_id);
-  };
 };
 
 #endif // SHARE_GC_G1_G1FULLGCREFERENCEPROCESSOREXECUTOR_HPP
--- a/src/hotspot/share/gc/parallel/pcTasks.cpp	Wed May 09 11:24:12 2018 +0200
+++ b/src/hotspot/share/gc/parallel/pcTasks.cpp	Wed May 09 13:37:05 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -167,17 +167,6 @@
   PSParallelCompact::gc_task_manager()->execute_and_wait(q);
 }
 
-void RefProcTaskExecutor::execute(EnqueueTask& task)
-{
-  ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
-  uint parallel_gc_threads = heap->gc_task_manager()->workers();
-  GCTaskQueue* q = GCTaskQueue::create();
-  for(uint i=0; i<parallel_gc_threads; i++) {
-    q->enqueue(new RefEnqueueTaskProxy(task, i));
-  }
-  PSParallelCompact::gc_task_manager()->execute_and_wait(q);
-}
-
 //
 // StealMarkingTask
 //
--- a/src/hotspot/share/gc/parallel/pcTasks.hpp	Wed May 09 11:24:12 2018 +0200
+++ b/src/hotspot/share/gc/parallel/pcTasks.hpp	Wed May 09 13:37:05 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -132,32 +132,6 @@
 };
 
 
-
-//
-// RefEnqueueTaskProxy
-//
-// This task is used as a proxy to parallel reference processing tasks .
-//
-
-class RefEnqueueTaskProxy: public GCTask {
-  typedef AbstractRefProcTaskExecutor::EnqueueTask EnqueueTask;
-  EnqueueTask& _enq_task;
-  uint         _work_id;
-
-public:
-  RefEnqueueTaskProxy(EnqueueTask& enq_task, uint work_id)
-    : _enq_task(enq_task),
-      _work_id(work_id)
-  { }
-
-  virtual char* name() { return (char *)"Enqueue reference objects in parallel"; }
-  virtual void do_it(GCTaskManager* manager, uint which)
-  {
-    _enq_task.work(_work_id);
-  }
-};
-
-
 //
 // RefProcTaskExecutor
 //
@@ -167,7 +141,6 @@
 
 class RefProcTaskExecutor: public AbstractRefProcTaskExecutor {
   virtual void execute(ProcessTask& task);
-  virtual void execute(EnqueueTask& task);
 };
 
 
--- a/src/hotspot/share/gc/parallel/psScavenge.cpp	Wed May 09 11:24:12 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psScavenge.cpp	Wed May 09 13:37:05 2018 +0200
@@ -148,27 +148,8 @@
   _rp_task.work(_work_id, is_alive, keep_alive, evac_followers);
 }
 
-class PSRefEnqueueTaskProxy: public GCTask {
-  typedef AbstractRefProcTaskExecutor::EnqueueTask EnqueueTask;
-  EnqueueTask& _enq_task;
-  uint         _work_id;
-
-public:
-  PSRefEnqueueTaskProxy(EnqueueTask& enq_task, uint work_id)
-    : _enq_task(enq_task),
-      _work_id(work_id)
-  { }
-
-  virtual char* name() { return (char *)"Enqueue reference objects in parallel"; }
-  virtual void do_it(GCTaskManager* manager, uint which)
-  {
-    _enq_task.work(_work_id);
-  }
-};
-
 class PSRefProcTaskExecutor: public AbstractRefProcTaskExecutor {
   virtual void execute(ProcessTask& task);
-  virtual void execute(EnqueueTask& task);
 };
 
 void PSRefProcTaskExecutor::execute(ProcessTask& task)
@@ -188,17 +169,6 @@
   manager->execute_and_wait(q);
 }
 
-
-void PSRefProcTaskExecutor::execute(EnqueueTask& task)
-{
-  GCTaskQueue* q = GCTaskQueue::create();
-  GCTaskManager* manager = ParallelScavengeHeap::gc_task_manager();
-  for(uint i=0; i < manager->active_workers(); i++) {
-    q->enqueue(new PSRefEnqueueTaskProxy(task, i));
-  }
-  manager->execute_and_wait(q);
-}
-
 // This method contains all heap specific policy for invoking scavenge.
 // PSScavenge::invoke_no_policy() will do nothing but attempt to
 // scavenge. It will not clean up after failed promotions, bail out if
--- a/src/hotspot/share/gc/shared/referenceProcessor.hpp	Wed May 09 11:24:12 2018 +0200
+++ b/src/hotspot/share/gc/shared/referenceProcessor.hpp	Wed May 09 13:37:05 2018 +0200
@@ -589,11 +589,9 @@
 
   // Abstract tasks to execute.
   class ProcessTask;
-  class EnqueueTask;
 
   // Executes a task using worker threads.
   virtual void execute(ProcessTask& task) = 0;
-  virtual void execute(EnqueueTask& task) = 0;
 
   // Switch to single threaded mode.
   virtual void set_single_threaded_mode() { };
@@ -628,27 +626,4 @@
   const bool                    _marks_oops_alive;
 };
 
-// Abstract reference processing task to execute.
-class AbstractRefProcTaskExecutor::EnqueueTask {
-protected:
-  EnqueueTask(ReferenceProcessor&           ref_processor,
-              DiscoveredList                refs_lists[],
-              int                           n_queues,
-              ReferenceProcessorPhaseTimes* phase_times)
-    : _ref_processor(ref_processor),
-      _refs_lists(refs_lists),
-      _n_queues(n_queues),
-      _phase_times(phase_times)
-  { }
-
-public:
-  virtual void work(unsigned int work_id) = 0;
-
-protected:
-  ReferenceProcessor&           _ref_processor;
-  DiscoveredList*               _refs_lists;
-  ReferenceProcessorPhaseTimes* _phase_times;
-  int                           _n_queues;
-};
-
 #endif // SHARE_VM_GC_SHARED_REFERENCEPROCESSOR_HPP