8225016: Dead code due to VMOperationQueue::add() always returning true
authorpchilanomate
Fri, 31 May 2019 11:17:55 -0400
changeset 55128 35192d9c2b76
parent 55127 f0ef081cb15d
child 55129 baad58d0cbfe
8225016: Dead code due to VMOperationQueue::add() always returning true Summary: Removed dead code in vmThread.cpp Reviewed-by: coleenp, hseigel, dholmes
src/hotspot/share/runtime/vmThread.cpp
src/hotspot/share/runtime/vmThread.hpp
--- a/src/hotspot/share/runtime/vmThread.cpp	Tue May 28 20:12:16 2019 +0200
+++ b/src/hotspot/share/runtime/vmThread.cpp	Fri May 31 11:17:55 2019 -0400
@@ -149,7 +149,7 @@
 
 //-----------------------------------------------------------------
 // High-level interface
-bool VMOperationQueue::add(VM_Operation *op) {
+void VMOperationQueue::add(VM_Operation *op) {
 
   HOTSPOT_VMOPS_REQUEST(
                    (char *) op->name(), strlen(op->name()),
@@ -157,13 +157,7 @@
 
   // Encapsulates VM queue policy. Currently, that
   // only involves putting them on the right list
-  if (op->evaluate_at_safepoint()) {
-    queue_add_back(SafepointPriority, op);
-    return true;
-  }
-
-  queue_add_back(MediumPriority, op);
-  return true;
+  queue_add_back(op->evaluate_at_safepoint() ? SafepointPriority : MediumPriority, op);
 }
 
 VM_Operation* VMOperationQueue::remove_next() {
@@ -702,16 +696,10 @@
     {
       VMOperationQueue_lock->lock_without_safepoint_check();
       log_debug(vmthread)("Adding VM operation: %s", op->name());
-      bool ok = _vm_queue->add(op);
+      _vm_queue->add(op);
       op->set_timestamp(os::javaTimeMillis());
       VMOperationQueue_lock->notify();
       VMOperationQueue_lock->unlock();
-      // VM_Operation got skipped
-      if (!ok) {
-        assert(concurrent, "can only skip concurrent tasks");
-        if (op->is_cheap_allocated()) delete op;
-        return;
-      }
     }
 
     if (!concurrent) {
--- a/src/hotspot/share/runtime/vmThread.hpp	Tue May 28 20:12:16 2019 +0200
+++ b/src/hotspot/share/runtime/vmThread.hpp	Fri May 31 11:17:55 2019 -0400
@@ -71,7 +71,7 @@
   VMOperationQueue();
 
   // Highlevel operations. Encapsulates policy
-  bool add(VM_Operation *op);
+  void add(VM_Operation *op);
   VM_Operation* remove_next();                        // Returns next or null
   VM_Operation* remove_next_at_safepoint_priority()   { return queue_remove_front(SafepointPriority); }
   VM_Operation* drain_at_safepoint_priority() { return queue_drain(SafepointPriority); }