3223 // for this space. |
3223 // for this space. |
3224 aligned_start = align_down(_restart_addr, CardTable::card_size); |
3224 aligned_start = align_down(_restart_addr, CardTable::card_size); |
3225 } |
3225 } |
3226 |
3226 |
3227 size_t chunk_size = sp->marking_task_size(); |
3227 size_t chunk_size = sp->marking_task_size(); |
3228 while (!pst->is_task_claimed(/* reference */ nth_task)) { |
3228 while (pst->try_claim_task(/* reference */ nth_task)) { |
3229 // Having claimed the nth task in this space, |
3229 // Having claimed the nth task in this space, |
3230 // compute the chunk that it corresponds to: |
3230 // compute the chunk that it corresponds to: |
3231 MemRegion span = MemRegion(aligned_start + nth_task*chunk_size, |
3231 MemRegion span = MemRegion(aligned_start + nth_task*chunk_size, |
3232 aligned_start + (nth_task+1)*chunk_size); |
3232 aligned_start + (nth_task+1)*chunk_size); |
3233 // Try and bump the global finger via a CAS; |
3233 // Try and bump the global finger via a CAS; |
4492 uint n_tasks = pst->n_tasks(); |
4492 uint n_tasks = pst->n_tasks(); |
4493 |
4493 |
4494 if (n_tasks > 0) { |
4494 if (n_tasks > 0) { |
4495 assert(pst->valid(), "Uninitialized use?"); |
4495 assert(pst->valid(), "Uninitialized use?"); |
4496 HeapWord *start, *end; |
4496 HeapWord *start, *end; |
4497 while (!pst->is_task_claimed(/* reference */ nth_task)) { |
4497 while (pst->try_claim_task(/* reference */ nth_task)) { |
4498 // We claimed task # nth_task; compute its boundaries. |
4498 // We claimed task # nth_task; compute its boundaries. |
4499 if (chunk_top == 0) { // no samples were taken |
4499 if (chunk_top == 0) { // no samples were taken |
4500 assert(nth_task == 0 && n_tasks == 1, "Can have only 1 eden task"); |
4500 assert(nth_task == 0 && n_tasks == 1, "Can have only 1 eden task"); |
4501 start = space->bottom(); |
4501 start = space->bottom(); |
4502 end = space->top(); |
4502 end = space->top(); |
4578 HeapWord* end_addr = align_up(span.end(), alignment); |
4578 HeapWord* end_addr = align_up(span.end(), alignment); |
4579 const size_t chunk_size = sp->rescan_task_size(); // in HeapWord units |
4579 const size_t chunk_size = sp->rescan_task_size(); // in HeapWord units |
4580 assert(is_aligned(start_addr, alignment), "Check alignment"); |
4580 assert(is_aligned(start_addr, alignment), "Check alignment"); |
4581 assert(is_aligned(chunk_size, alignment), "Check alignment"); |
4581 assert(is_aligned(chunk_size, alignment), "Check alignment"); |
4582 |
4582 |
4583 while (!pst->is_task_claimed(/* reference */ nth_task)) { |
4583 while (pst->try_claim_task(/* reference */ nth_task)) { |
4584 // Having claimed the nth_task, compute corresponding mem-region, |
4584 // Having claimed the nth_task, compute corresponding mem-region, |
4585 // which is a-fortiori aligned correctly (i.e. at a MUT boundary). |
4585 // which is a-fortiori aligned correctly (i.e. at a MUT boundary). |
4586 // The alignment restriction ensures that we do not need any |
4586 // The alignment restriction ensures that we do not need any |
4587 // synchronization with other gang-workers while setting or |
4587 // synchronization with other gang-workers while setting or |
4588 // clearing bits in thus chunk of the MUT. |
4588 // clearing bits in thus chunk of the MUT. |