Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8225016

Dead code due to VMOperationQueue::add() always returning true

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 13
    • Fix Version/s: 13
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b24

      Backports

        Description

        In vmThread.cpp we have the following code:

        bool ok = _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;
        }

        but VMOperationQueue::add(VM_Operation *op) always returns true:

        bool VMOperationQueue::add(VM_Operation *op) {

          HOTSPOT_VMOPS_REQUEST(
                           (char *) op->name(), strlen(op->name()),
                           op->evaluation_mode());

          // 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;
        }

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                pchilanomate Patricio Chilano Mateo
                Reporter:
                pchilanomate Patricio Chilano Mateo
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: