< prev index next >

src/hotspot/share/gc/g1/dirtyCardQueue.cpp

Print this page
rev 53151 : [mq]: tschatzl_review


  62   PtrQueue(qset, permanent, true /* active */)
  63 { }
  64 
  65 DirtyCardQueue::~DirtyCardQueue() {
  66   if (!is_permanent()) {
  67     flush();
  68   }
  69 }
  70 
  71 DirtyCardQueueSet::DirtyCardQueueSet(bool notify_when_complete) :
  72   PtrQueueSet(notify_when_complete),
  73   _shared_dirty_card_queue(this, true /* permanent */),
  74   _free_ids(NULL),
  75   _processed_buffers_mut(0),
  76   _processed_buffers_rs_thread(0),
  77   _cur_par_buffer_node(NULL)
  78 {
  79   _all_active = true;
  80 }
  81 




  82 // Determines how many mutator threads can process the buffers in parallel.
  83 uint DirtyCardQueueSet::num_par_ids() {
  84   return (uint)os::initial_active_processor_count();
  85 }
  86 
  87 void DirtyCardQueueSet::initialize(Monitor* cbl_mon,
  88                                    BufferNode::Allocator* allocator,
  89                                    Mutex* lock,
  90                                    bool init_free_ids) {
  91   PtrQueueSet::initialize(cbl_mon, allocator);
  92   _shared_dirty_card_queue.set_lock(lock);
  93   if (init_free_ids) {
  94     _free_ids = new G1FreeIdSet(0, num_par_ids());
  95   }
  96 }
  97 
  98 void DirtyCardQueueSet::handle_zero_index_for_thread(JavaThread* t) {
  99   G1ThreadLocalData::dirty_card_queue(t).handle_zero_index();
 100 }
 101 




  62   PtrQueue(qset, permanent, true /* active */)
  63 { }
  64 
  65 DirtyCardQueue::~DirtyCardQueue() {
  66   if (!is_permanent()) {
  67     flush();
  68   }
  69 }
  70 
  71 DirtyCardQueueSet::DirtyCardQueueSet(bool notify_when_complete) :
  72   PtrQueueSet(notify_when_complete),
  73   _shared_dirty_card_queue(this, true /* permanent */),
  74   _free_ids(NULL),
  75   _processed_buffers_mut(0),
  76   _processed_buffers_rs_thread(0),
  77   _cur_par_buffer_node(NULL)
  78 {
  79   _all_active = true;
  80 }
  81 
  82 DirtyCardQueueSet::~DirtyCardQueueSet() {
  83   delete _free_ids;
  84 }
  85 
  86 // Determines how many mutator threads can process the buffers in parallel.
  87 uint DirtyCardQueueSet::num_par_ids() {
  88   return (uint)os::initial_active_processor_count();
  89 }
  90 
  91 void DirtyCardQueueSet::initialize(Monitor* cbl_mon,
  92                                    BufferNode::Allocator* allocator,
  93                                    Mutex* lock,
  94                                    bool init_free_ids) {
  95   PtrQueueSet::initialize(cbl_mon, allocator);
  96   _shared_dirty_card_queue.set_lock(lock);
  97   if (init_free_ids) {
  98     _free_ids = new G1FreeIdSet(0, num_par_ids());
  99   }
 100 }
 101 
 102 void DirtyCardQueueSet::handle_zero_index_for_thread(JavaThread* t) {
 103   G1ThreadLocalData::dirty_card_queue(t).handle_zero_index();
 104 }
 105 


< prev index next >