< prev index next >
src/share/vm/gc_implementation/g1/satbQueue.cpp
Print this page
rev 7211 : 6979279
rev 7216 : [mq]: rev5
*** 200,220 ****
#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),
_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) {
DEBUG_ONLY(t->satb_mark_queue().verify_oops_in_buffer();)
t->satb_mark_queue().handle_zero_index();
--- 200,218 ----
#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(), _closures(NULL),
_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);
! _closures = NEW_C_HEAP_ARRAY(ObjectClosure*, ParallelGCThreads, mtGC);
}
void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) {
DEBUG_ONLY(t->satb_mark_queue().verify_oops_in_buffer();)
t->satb_mark_queue().handle_zero_index();
*** 274,294 ****
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) {
BufferNode* nd = NULL;
{
MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
if (_completed_buffers_head != NULL) {
nd = _completed_buffers_head;
--- 272,288 ----
t->satb_mark_queue().filter();
}
shared_satb_queue()->filter();
}
! void SATBMarkQueueSet::set_closure(uint worker, ObjectClosure* closure) {
! assert(_closures != NULL, "Precondition");
! assert(worker < ParallelGCThreads, "Worker index must be in range [0...ParallelGCThreads)");
! _closures[worker] = closure;
}
! bool SATBMarkQueueSet::apply_closure_to_completed_buffer(uint worker) {
BufferNode* nd = NULL;
{
MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
if (_completed_buffers_head != NULL) {
nd = _completed_buffers_head;
*** 296,306 ****
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;
--- 290,300 ----
if (_completed_buffers_head == NULL) _completed_buffers_tail = NULL;
_n_completed_buffers--;
if (_n_completed_buffers == 0) _process_completed = false;
}
}
! ObjectClosure* cl = _closures[worker];
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 >