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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 13
    • 13
    • hotspot
    • b24

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

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

                Created:
                Updated:
                Resolved: