changeset 57733:d8341e9ad86d

8236766: Remove un-used oops do and drain list in VM thread. Reviewed-by: dholmes, coleenp
author rehn
date Fri, 17 Jan 2020 16:17:22 +0100
parents 2186f9d477c1
children ed8e7bf32188
files src/hotspot/share/runtime/vmOperations.hpp src/hotspot/share/runtime/vmThread.cpp src/hotspot/share/runtime/vmThread.hpp
diffstat 3 files changed, 0 insertions(+), 79 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/runtime/vmOperations.hpp	Fri Jan 17 12:53:31 2020 +0000
+++ b/src/hotspot/share/runtime/vmOperations.hpp	Fri Jan 17 16:17:22 2020 +0100
@@ -42,7 +42,6 @@
 #define VM_OPS_DO(template)                       \
   template(None)                                  \
   template(Cleanup)                               \
-  template(ThreadStop)                            \
   template(ThreadDump)                            \
   template(PrintThreads)                          \
   template(FindDeadlocks)                         \
@@ -177,7 +176,6 @@
   // Configuration. Override these appropriately in subclasses.
   virtual VMOp_Type type() const = 0;
   virtual bool allow_nested_vm_operations() const { return false; }
-  virtual void oops_do(OopClosure* f)              { /* do nothing */ };
 
   // An operation can either be done inside a safepoint
   // or concurrently with Java threads running.
--- a/src/hotspot/share/runtime/vmThread.cpp	Fri Jan 17 12:53:31 2020 +0000
+++ b/src/hotspot/share/runtime/vmThread.cpp	Fri Jan 17 16:17:22 2020 +0100
@@ -62,7 +62,6 @@
     _queue[i]->set_next(_queue[i]);
     _queue[i]->set_prev(_queue[i]);
   }
-  _drain_list = NULL;
 }
 
 
@@ -128,23 +127,6 @@
   return r;
 }
 
-void VMOperationQueue::queue_oops_do(int queue, OopClosure* f) {
-  VM_Operation* cur = _queue[queue];
-  cur = cur->next();
-  while (cur != _queue[queue]) {
-    cur->oops_do(f);
-    cur = cur->next();
-  }
-}
-
-void VMOperationQueue::drain_list_oops_do(OopClosure* f) {
-  VM_Operation* cur = _drain_list;
-  while (cur != NULL) {
-    cur->oops_do(f);
-    cur = cur->next();
-  }
-}
-
 //-----------------------------------------------------------------
 // High-level interface
 void VMOperationQueue::add(VM_Operation *op) {
@@ -179,13 +161,6 @@
   return queue_remove_front(queue_empty(high_prio) ? low_prio : high_prio);
 }
 
-void VMOperationQueue::oops_do(OopClosure* f) {
-  for(int i = 0; i < nof_priorities; i++) {
-    queue_oops_do(i, f);
-  }
-  drain_list_oops_do(f);
-}
-
 //------------------------------------------------------------------------------------------------------------------
 // Timeout machinery
 
@@ -534,8 +509,6 @@
       if (_cur_vm_operation->evaluate_at_safepoint()) {
         log_debug(vmthread)("Evaluating safepoint VM operation: %s", _cur_vm_operation->name());
 
-        _vm_queue->set_drain_list(safepoint_ops); // ensure ops can be scanned
-
         SafepointSynchronize::begin();
 
         if (_timeout_task != NULL) {
@@ -554,7 +527,6 @@
               // evaluate_operation deletes the op object so we have
               // to grab the next op now
               VM_Operation* next = _cur_vm_operation->next();
-              _vm_queue->set_drain_list(next);
               evaluate_operation(_cur_vm_operation);
               _cur_vm_operation = next;
               _coalesced_count++;
@@ -580,8 +552,6 @@
           }
         } while(safepoint_ops != NULL);
 
-        _vm_queue->set_drain_list(NULL);
-
         if (_timeout_task != NULL) {
           _timeout_task->disarm();
         }
@@ -715,39 +685,6 @@
   }
 }
 
-
-void VMThread::oops_do(OopClosure* f, CodeBlobClosure* cf) {
-  Thread::oops_do(f, cf);
-  _vm_queue->oops_do(f);
-}
-
-//------------------------------------------------------------------------------------------------------------------
-#ifndef PRODUCT
-
-void VMOperationQueue::verify_queue(int prio) {
-  // Check that list is correctly linked
-  int length = _queue_length[prio];
-  VM_Operation *cur = _queue[prio];
-  int i;
-
-  // Check forward links
-  for(i = 0; i < length; i++) {
-    cur = cur->next();
-    assert(cur != _queue[prio], "list to short (forward)");
-  }
-  assert(cur->next() == _queue[prio], "list to long (forward)");
-
-  // Check backwards links
-  cur = _queue[prio];
-  for(i = 0; i < length; i++) {
-    cur = cur->prev();
-    assert(cur != _queue[prio], "list to short (backwards)");
-  }
-  assert(cur->prev() == _queue[prio], "list to long (backwards)");
-}
-
-#endif
-
 void VMThread::verify() {
   oops_do(&VerifyOopClosure::verify_oop, NULL);
 }
--- a/src/hotspot/share/runtime/vmThread.hpp	Fri Jan 17 12:53:31 2020 +0000
+++ b/src/hotspot/share/runtime/vmThread.hpp	Fri Jan 17 16:17:22 2020 +0100
@@ -53,9 +53,6 @@
   int           _queue_length[nof_priorities];
   int           _queue_counter;
   VM_Operation* _queue       [nof_priorities];
-  // we also allow the vmThread to register the ops it has drained so we
-  // can scan them from oops_do
-  VM_Operation* _drain_list;
 
   static VM_QueueHead _queue_head[nof_priorities];
 
@@ -67,8 +64,6 @@
   bool queue_empty                (int prio);
   void queue_add                  (int prio, VM_Operation *op);
   VM_Operation* queue_remove_front(int prio);
-  void queue_oops_do(int queue, OopClosure* f);
-  void drain_list_oops_do(OopClosure* f);
   VM_Operation* queue_drain(int prio);
   // lock-free query: may return the wrong answer but must not break
   bool queue_peek(int prio) { return _queue_length[prio] > 0; }
@@ -80,13 +75,7 @@
   void add(VM_Operation *op);
   VM_Operation* remove_next();                        // Returns next or null
   VM_Operation* drain_at_safepoint_priority() { return queue_drain(SafepointPriority); }
-  void set_drain_list(VM_Operation* list) { _drain_list = list; }
   bool peek_at_safepoint_priority() { return queue_peek(SafepointPriority); }
-
-  // GC support
-  void oops_do(OopClosure* f);
-
-  void verify_queue(int prio) PRODUCT_RETURN;
 };
 
 
@@ -165,9 +154,6 @@
   // Returns the single instance of VMThread.
   static VMThread* vm_thread()                    { return _vm_thread; }
 
-  // GC support
-  void oops_do(OopClosure* f, CodeBlobClosure* cf);
-
   void verify();
 
   // Performance measurement