571 for (uint i = 0; i < max_regions; i++) {
572 _region_mark_stats[i].clear_during_overflow();
573 }
574 }
575
576 clear_has_overflown();
577 _finger = _heap.start();
578
579 for (uint i = 0; i < _max_num_tasks; ++i) {
580 G1CMTaskQueue* queue = _task_queues->queue(i);
581 queue->set_empty();
582 }
583 }
584
585 void G1ConcurrentMark::set_concurrency(uint active_tasks) {
586 assert(active_tasks <= _max_num_tasks, "we should not have more");
587
588 _num_active_tasks = active_tasks;
589 // Need to update the three data structures below according to the
590 // number of active threads for this phase.
591 _terminator = TaskTerminator((int) active_tasks, _task_queues);
592 _first_overflow_barrier_sync.set_n_workers((int) active_tasks);
593 _second_overflow_barrier_sync.set_n_workers((int) active_tasks);
594 }
595
596 void G1ConcurrentMark::set_concurrency_and_phase(uint active_tasks, bool concurrent) {
597 set_concurrency(active_tasks);
598
599 _concurrent = concurrent;
600
601 if (!concurrent) {
602 // At this point we should be in a STW phase, and completed marking.
603 assert_at_safepoint_on_vm_thread();
604 assert(out_of_regions(),
605 "only way to get here: _finger: " PTR_FORMAT ", _heap_end: " PTR_FORMAT,
606 p2i(_finger), p2i(_heap.end()));
607 }
608 }
609
610 void G1ConcurrentMark::reset_at_marking_complete() {
611 // We set the global marking state to some default values when we're
|
571 for (uint i = 0; i < max_regions; i++) {
572 _region_mark_stats[i].clear_during_overflow();
573 }
574 }
575
576 clear_has_overflown();
577 _finger = _heap.start();
578
579 for (uint i = 0; i < _max_num_tasks; ++i) {
580 G1CMTaskQueue* queue = _task_queues->queue(i);
581 queue->set_empty();
582 }
583 }
584
585 void G1ConcurrentMark::set_concurrency(uint active_tasks) {
586 assert(active_tasks <= _max_num_tasks, "we should not have more");
587
588 _num_active_tasks = active_tasks;
589 // Need to update the three data structures below according to the
590 // number of active threads for this phase.
591 _terminator.terminator()->reset_for_reuse((int) active_tasks);
592 _first_overflow_barrier_sync.set_n_workers((int) active_tasks);
593 _second_overflow_barrier_sync.set_n_workers((int) active_tasks);
594 }
595
596 void G1ConcurrentMark::set_concurrency_and_phase(uint active_tasks, bool concurrent) {
597 set_concurrency(active_tasks);
598
599 _concurrent = concurrent;
600
601 if (!concurrent) {
602 // At this point we should be in a STW phase, and completed marking.
603 assert_at_safepoint_on_vm_thread();
604 assert(out_of_regions(),
605 "only way to get here: _finger: " PTR_FORMAT ", _heap_end: " PTR_FORMAT,
606 p2i(_finger), p2i(_heap.end()));
607 }
608 }
609
610 void G1ConcurrentMark::reset_at_marking_complete() {
611 // We set the global marking state to some default values when we're
|