8236766: Remove un-used oops do and drain list in VM thread

Reviewed-by: dholmes, coleenp
This commit is contained in:
Robbin Ehn 2020-01-17 16:17:22 +01:00
parent a589a15e3f
commit 39992dea38
3 changed files with 0 additions and 79 deletions

View File

@ -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 @@ class VM_Operation : public StackObj {
// 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.

View File

@ -62,7 +62,6 @@ VMOperationQueue::VMOperationQueue() {
_queue[i]->set_next(_queue[i]);
_queue[i]->set_prev(_queue[i]);
}
_drain_list = NULL;
}
@ -128,23 +127,6 @@ VM_Operation* VMOperationQueue::queue_drain(int prio) {
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 @@ VM_Operation* VMOperationQueue::remove_next() {
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 @@ void VMThread::loop() {
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 @@ void VMThread::loop() {
// 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 @@ void VMThread::loop() {
}
} while(safepoint_ops != NULL);
_vm_queue->set_drain_list(NULL);
if (_timeout_task != NULL) {
_timeout_task->disarm();
}
@ -715,39 +685,6 @@ void VMThread::execute(VM_Operation* op) {
}
}
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);
}

View File

@ -53,9 +53,6 @@ class VMOperationQueue : public CHeapObj<mtInternal> {
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 @@ class VMOperationQueue : public CHeapObj<mtInternal> {
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 @@ class VMOperationQueue : public CHeapObj<mtInternal> {
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 @@ class VMThread: public NamedThread {
// 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