< prev index next >

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

Print this page
rev 47287 : Port 09.17.Thread_SMR_logging_update from JDK9 to JDK10
rev 47289 : eosterlund, stefank CR - refactor code into threadSMR.cpp and threadSMR.hpp
rev 47292 : stefank, coleenp CR - refactor most JavaThreadIterator usage to use JavaThreadIteratorWithHandle.


 303       nd->set_next(buffers_to_delete);
 304       buffers_to_delete = nd;
 305     }
 306     _n_completed_buffers = 0;
 307     _completed_buffers_tail = NULL;
 308     DEBUG_ONLY(assert_completed_buffer_list_len_correct_locked());
 309   }
 310   while (buffers_to_delete != NULL) {
 311     BufferNode* nd = buffers_to_delete;
 312     buffers_to_delete = nd->next();
 313     deallocate_buffer(nd);
 314   }
 315 
 316 }
 317 
 318 void DirtyCardQueueSet::abandon_logs() {
 319   assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
 320   clear();
 321   // Since abandon is done only at safepoints, we can safely manipulate
 322   // these queues.
 323   {
 324     ThreadsListHandle tlh;
 325     JavaThreadIterator jti(tlh.list());
 326     for (JavaThread* t = jti.first(); t != NULL; t = jti.next()) {
 327       t->dirty_card_queue().reset();
 328     }
 329   }
 330   shared_dirty_card_queue()->reset();
 331 }
 332 
 333 void DirtyCardQueueSet::concatenate_log(DirtyCardQueue& dcq) {
 334   if (!dcq.is_empty()) {
 335     dcq.flush();
 336   }
 337 }
 338 
 339 void DirtyCardQueueSet::concatenate_logs() {
 340   // Iterate over all the threads, if we find a partial log add it to
 341   // the global list of logs.  Temporarily turn off the limit on the number
 342   // of outstanding buffers.
 343   int save_max_completed_queue = _max_completed_queue;
 344   _max_completed_queue = max_jint;
 345   assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
 346   {
 347     ThreadsListHandle tlh;
 348     JavaThreadIterator jti(tlh.list());
 349     for (JavaThread* t = jti.first(); t != NULL; t = jti.next()) {
 350       concatenate_log(t->dirty_card_queue());
 351     }
 352   }
 353   concatenate_log(_shared_dirty_card_queue);
 354   // Restore the completed buffer queue limit.
 355   _max_completed_queue = save_max_completed_queue;
 356 }


 303       nd->set_next(buffers_to_delete);
 304       buffers_to_delete = nd;
 305     }
 306     _n_completed_buffers = 0;
 307     _completed_buffers_tail = NULL;
 308     DEBUG_ONLY(assert_completed_buffer_list_len_correct_locked());
 309   }
 310   while (buffers_to_delete != NULL) {
 311     BufferNode* nd = buffers_to_delete;
 312     buffers_to_delete = nd->next();
 313     deallocate_buffer(nd);
 314   }
 315 
 316 }
 317 
 318 void DirtyCardQueueSet::abandon_logs() {
 319   assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
 320   clear();
 321   // Since abandon is done only at safepoints, we can safely manipulate
 322   // these queues.
 323   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) {



 324     t->dirty_card_queue().reset();
 325   }

 326   shared_dirty_card_queue()->reset();
 327 }
 328 
 329 void DirtyCardQueueSet::concatenate_log(DirtyCardQueue& dcq) {
 330   if (!dcq.is_empty()) {
 331     dcq.flush();
 332   }
 333 }
 334 
 335 void DirtyCardQueueSet::concatenate_logs() {
 336   // Iterate over all the threads, if we find a partial log add it to
 337   // the global list of logs.  Temporarily turn off the limit on the number
 338   // of outstanding buffers.
 339   int save_max_completed_queue = _max_completed_queue;
 340   _max_completed_queue = max_jint;
 341   assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
 342   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) {



 343     concatenate_log(t->dirty_card_queue());
 344   }

 345   concatenate_log(_shared_dirty_card_queue);
 346   // Restore the completed buffer queue limit.
 347   _max_completed_queue = save_max_completed_queue;
 348 }
< prev index next >