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

Removed dead code in vmThread.cpp

Reviewed-by: coleenp, hseigel, dholmes
This commit is contained in:
Patricio Chilano Mateo 2019-05-31 11:17:55 -04:00
parent bb2e4df367
commit 84242de3ef
2 changed files with 4 additions and 16 deletions

View File

@ -149,7 +149,7 @@ void VMOperationQueue::drain_list_oops_do(OopClosure* f) {
//-----------------------------------------------------------------
// 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 @@ bool VMOperationQueue::add(VM_Operation *op) {
// 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 @@ void VMThread::execute(VM_Operation* op) {
{
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) {

View File

@ -71,7 +71,7 @@ class VMOperationQueue : public CHeapObj<mtInternal> {
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); }