< prev index next >
src/share/vm/gc_implementation/g1/satbQueue.cpp
Print this page
rev 7325 : 8078021: SATB apply_closure_to_completed_buffer should have closure argument
Summary: Apply closure directly, eliminating registration.
Reviewed-by: stefank, tschatzl
@@ -225,21 +225,18 @@
#ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away
#pragma warning( disable:4355 ) // 'this' : used in base member initializer list
#endif // _MSC_VER
SATBMarkQueueSet::SATBMarkQueueSet() :
- PtrQueueSet(), _closure(NULL), _par_closures(NULL),
+ PtrQueueSet(),
_shared_satb_queue(this, true /*perm*/) { }
void SATBMarkQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock,
int process_completed_threshold,
Mutex* lock) {
PtrQueueSet::initialize(cbl_mon, fl_lock, process_completed_threshold, -1);
_shared_satb_queue.set_lock(lock);
- if (ParallelGCThreads > 0) {
- _par_closures = NEW_C_HEAP_ARRAY(ObjectClosure*, ParallelGCThreads, mtGC);
- }
}
void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) {
t->satb_mark_queue().handle_zero_index();
}
@@ -298,21 +295,11 @@
t->satb_mark_queue().filter();
}
shared_satb_queue()->filter();
}
-void SATBMarkQueueSet::set_closure(ObjectClosure* closure) {
- _closure = closure;
-}
-
-void SATBMarkQueueSet::set_par_closure(int i, ObjectClosure* par_closure) {
- assert(ParallelGCThreads > 0 && _par_closures != NULL, "Precondition");
- _par_closures[i] = par_closure;
-}
-
-bool SATBMarkQueueSet::apply_closure_to_completed_buffer_work(bool par,
- uint worker) {
+bool SATBMarkQueueSet::apply_closure_to_completed_buffer(ObjectClosure* cl) {
BufferNode* nd = NULL;
{
MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
if (_completed_buffers_head != NULL) {
nd = _completed_buffers_head;
@@ -320,11 +307,10 @@
if (_completed_buffers_head == NULL) _completed_buffers_tail = NULL;
_n_completed_buffers--;
if (_n_completed_buffers == 0) _process_completed = false;
}
}
- ObjectClosure* cl = (par ? _par_closures[worker] : _closure);
if (nd != NULL) {
void **buf = BufferNode::make_buffer_from_node(nd);
ObjPtrQueue::apply_closure_to_buffer(cl, buf, 0, _sz);
deallocate_buffer(buf);
return true;
< prev index next >