src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp

changeset 775
ebeb6490b814
parent 704
850fdf70db2b
child 795
5d254928c888
equal deleted inserted replaced
736:387a62b4be60 775:ebeb6490b814
2788 initialize_sequential_subtasks_for_rescan(int n_threads) { 2788 initialize_sequential_subtasks_for_rescan(int n_threads) {
2789 // The "size" of each task is fixed according to rescan_task_size. 2789 // The "size" of each task is fixed according to rescan_task_size.
2790 assert(n_threads > 0, "Unexpected n_threads argument"); 2790 assert(n_threads > 0, "Unexpected n_threads argument");
2791 const size_t task_size = rescan_task_size(); 2791 const size_t task_size = rescan_task_size();
2792 size_t n_tasks = (used_region().word_size() + task_size - 1)/task_size; 2792 size_t n_tasks = (used_region().word_size() + task_size - 1)/task_size;
2793 assert((used_region().start() + (n_tasks - 1)*task_size < 2793 assert((n_tasks == 0) == used_region().is_empty(), "n_tasks incorrect");
2794 used_region().end()) && 2794 assert(n_tasks == 0 ||
2795 (used_region().start() + n_tasks*task_size >= 2795 ((used_region().start() + (n_tasks - 1)*task_size < used_region().end()) &&
2796 used_region().end()), "n_task calculation incorrect"); 2796 (used_region().start() + n_tasks*task_size >= used_region().end())),
2797 "n_tasks calculation incorrect");
2797 SequentialSubTasksDone* pst = conc_par_seq_tasks(); 2798 SequentialSubTasksDone* pst = conc_par_seq_tasks();
2798 assert(!pst->valid(), "Clobbering existing data?"); 2799 assert(!pst->valid(), "Clobbering existing data?");
2799 pst->set_par_threads(n_threads); 2800 pst->set_par_threads(n_threads);
2800 pst->set_n_tasks((int)n_tasks); 2801 pst->set_n_tasks((int)n_tasks);
2801 } 2802 }
2831 size_t n_tasks = (span.word_size() + task_size - 1)/task_size; 2832 size_t n_tasks = (span.word_size() + task_size - 1)/task_size;
2832 assert((n_tasks == 0) == span.is_empty(), "Inconsistency"); 2833 assert((n_tasks == 0) == span.is_empty(), "Inconsistency");
2833 assert(n_tasks == 0 || 2834 assert(n_tasks == 0 ||
2834 ((span.start() + (n_tasks - 1)*task_size < span.end()) && 2835 ((span.start() + (n_tasks - 1)*task_size < span.end()) &&
2835 (span.start() + n_tasks*task_size >= span.end())), 2836 (span.start() + n_tasks*task_size >= span.end())),
2836 "n_task calculation incorrect"); 2837 "n_tasks calculation incorrect");
2837 SequentialSubTasksDone* pst = conc_par_seq_tasks(); 2838 SequentialSubTasksDone* pst = conc_par_seq_tasks();
2838 assert(!pst->valid(), "Clobbering existing data?"); 2839 assert(!pst->valid(), "Clobbering existing data?");
2839 pst->set_par_threads(n_threads); 2840 pst->set_par_threads(n_threads);
2840 pst->set_n_tasks((int)n_tasks); 2841 pst->set_n_tasks((int)n_tasks);
2841 } 2842 }

mercurial