< prev index next >

src/share/vm/gc/shenandoah/shenandoahConcurrentMark.cpp

Print this page
rev 12191 : [mq]: cancel.patch


 865 }
 866 
 867 SCMObjToScanQueue* ShenandoahConcurrentMark::get_queue(uint worker_id) {
 868   assert (worker_id < _max_conc_worker_id, "valid worker id: %d", worker_id);
 869   return _task_queues->queue(worker_id);
 870 }
 871 
 872 void ShenandoahConcurrentMark::clear_queue(SCMObjToScanQueue *q) {
 873   q->set_empty();
 874   q->overflow_stack()->clear();
 875   q->clear_buffer();
 876 }
 877 
 878 template <class T, bool CL>
 879 void ShenandoahConcurrentMark::concurrent_mark_loop(ShenandoahMarkObjsClosure<T, CL>* cl,
 880                                                     uint worker_id,
 881                                                     SCMObjToScanQueue* q,
 882                                                     ParallelTaskTerminator* terminator) {
 883   ShenandoahHeap* heap = ShenandoahHeap::heap();
 884   int seed = 17;
 885   while (true) {
 886     if (heap->cancelled_concgc()) clear_queue(q);
 887     if (heap->cancelled_concgc() ||
 888         (!try_queue(q, cl) &&






 889          !try_draining_an_satb_buffer(q) &&
 890          !try_to_steal(worker_id, cl, &seed))
 891         ) {
 892       if (terminator->offer_termination()) break;

 893     }
 894   }
 895 }
 896 
 897 template <class T, bool CL>
 898 void ShenandoahConcurrentMark::final_mark_loop(ShenandoahMarkObjsClosure<T, CL>* cl,
 899                                                uint worker_id,
 900                                                SCMObjToScanQueue* q,
 901                                                ParallelTaskTerminator* terminator) {
 902   int seed = 17;
 903   while (true) {
 904     if (!try_queue(q, cl) &&
 905         !try_to_steal(worker_id, cl, &seed)) {
 906       if (terminator->offer_termination()) break;
 907     }
 908   }
 909 }
 910 
 911 void ShenandoahConcurrentMark::set_process_references(bool pr) {
 912   _process_references = pr;




 865 }
 866 
 867 SCMObjToScanQueue* ShenandoahConcurrentMark::get_queue(uint worker_id) {
 868   assert (worker_id < _max_conc_worker_id, "valid worker id: %d", worker_id);
 869   return _task_queues->queue(worker_id);
 870 }
 871 
 872 void ShenandoahConcurrentMark::clear_queue(SCMObjToScanQueue *q) {
 873   q->set_empty();
 874   q->overflow_stack()->clear();
 875   q->clear_buffer();
 876 }
 877 
 878 template <class T, bool CL>
 879 void ShenandoahConcurrentMark::concurrent_mark_loop(ShenandoahMarkObjsClosure<T, CL>* cl,
 880                                                     uint worker_id,
 881                                                     SCMObjToScanQueue* q,
 882                                                     ParallelTaskTerminator* terminator) {
 883   ShenandoahHeap* heap = ShenandoahHeap::heap();
 884   int seed = 17;
 885   bool terminate = false;
 886   uint stride = ShenandoahMarkLoopStride;
 887   while (! terminate) {
 888     if (heap->cancelled_concgc()) {
 889       clear_queue(q);
 890       while (! terminator->offer_termination());
 891       return;
 892     }
 893     for (uint i = 0; i < stride && ! terminate; i++) {
 894       if (!try_queue(q, cl) &&
 895           !try_draining_an_satb_buffer(q) &&
 896           !try_to_steal(worker_id, cl, &seed)
 897           ) {
 898         if (terminator->offer_termination()) terminate = true;
 899       }
 900     }
 901   }
 902 }
 903 
 904 template <class T, bool CL>
 905 void ShenandoahConcurrentMark::final_mark_loop(ShenandoahMarkObjsClosure<T, CL>* cl,
 906                                                uint worker_id,
 907                                                SCMObjToScanQueue* q,
 908                                                ParallelTaskTerminator* terminator) {
 909   int seed = 17;
 910   while (true) {
 911     if (!try_queue(q, cl) &&
 912         !try_to_steal(worker_id, cl, &seed)) {
 913       if (terminator->offer_termination()) break;
 914     }
 915   }
 916 }
 917 
 918 void ShenandoahConcurrentMark::set_process_references(bool pr) {
 919   _process_references = pr;


< prev index next >