src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp
changeset 58059 baa4dd528de0
parent 58033 9162feb63c42
child 58508 d6058bd73982
equal deleted inserted replaced
58058:b553ad95acf0 58059:baa4dd528de0
    60   } else {
    60   } else {
    61     allocate_buffer();          // Buffer enqueued, get a new one.
    61     allocate_buffer();          // Buffer enqueued, get a new one.
    62   }
    62   }
    63 }
    63 }
    64 
    64 
    65 G1DirtyCardQueueSet::G1DirtyCardQueueSet() :
    65 G1DirtyCardQueueSet::G1DirtyCardQueueSet(Monitor* cbl_mon,
    66   PtrQueueSet(),
    66                                          BufferNode::Allocator* allocator) :
    67   _cbl_mon(NULL),
    67   PtrQueueSet(allocator),
       
    68   _cbl_mon(cbl_mon),
    68   _completed_buffers_head(NULL),
    69   _completed_buffers_head(NULL),
    69   _completed_buffers_tail(NULL),
    70   _completed_buffers_tail(NULL),
    70   _num_cards(0),
    71   _num_cards(0),
    71   _process_cards_threshold(ProcessCardsThresholdNever),
    72   _process_cards_threshold(ProcessCardsThresholdNever),
    72   _process_completed_buffers(false),
    73   _process_completed_buffers(false),
    84 }
    85 }
    85 
    86 
    86 // Determines how many mutator threads can process the buffers in parallel.
    87 // Determines how many mutator threads can process the buffers in parallel.
    87 uint G1DirtyCardQueueSet::num_par_ids() {
    88 uint G1DirtyCardQueueSet::num_par_ids() {
    88   return (uint)os::initial_active_processor_count();
    89   return (uint)os::initial_active_processor_count();
    89 }
       
    90 
       
    91 void G1DirtyCardQueueSet::initialize(Monitor* cbl_mon,
       
    92                                      BufferNode::Allocator* allocator) {
       
    93   PtrQueueSet::initialize(allocator);
       
    94   assert(_cbl_mon == NULL, "Init order issue?");
       
    95   _cbl_mon = cbl_mon;
       
    96 }
    90 }
    97 
    91 
    98 void G1DirtyCardQueueSet::handle_zero_index_for_thread(Thread* t) {
    92 void G1DirtyCardQueueSet::handle_zero_index_for_thread(Thread* t) {
    99   G1ThreadLocalData::dirty_card_queue(t).handle_zero_index();
    93   G1ThreadLocalData::dirty_card_queue(t).handle_zero_index();
   100 }
    94 }