73 ShenandoahConnectionMatrix* matrix = _heap->connection_matrix();
74 SCMObjToScanQueueSet* queues = _heap->partial_gc()->task_queues();
75 SCMObjToScanQueue* q = queues->queue(worker_id);
76
77 // Step 1: Process ordinary GC roots.
78 {
79 PartialEvacuateUpdateRootsClosure roots_cl(q);
80 CLDToOopClosure cld_cl(&roots_cl);
81 MarkingCodeBlobClosure code_cl(&roots_cl, CodeBlobToOopClosure::FixRelocations);
82 _rp->process_all_roots(&roots_cl, &roots_cl, &cld_cl, &code_cl, worker_id);
83 }
84 if (check_and_handle_cancelled_gc()) return;
85
86 PartialEvacuateUpdateHeapClosure cl(q);
87
88 // Step 2: Process all root regions.
89 {
90 ShenandoahHeapRegion* r = _root_regions->claim_next();
91 while (r != NULL) {
92 assert(r->is_root(), "must be root region");
93 if (! r->is_humongous_continuation()) {
94 _heap->marked_object_oop_iterate(r, &cl);
95 }
96 r->set_root(false);
97 if (check_and_handle_cancelled_gc()) return;
98 r = _root_regions->claim_next();
99 }
100 }
101 if (check_and_handle_cancelled_gc()) return;
102
103 // Step 3: Drain all outstanding work in queues.
104 {
105 int seed = 17;
106 SCMTask task;
107
108 uint stride = ShenandoahMarkLoopStride;
109
110 while (true) {
111 if (check_and_handle_cancelled_gc()) return;
112
113 for (uint i = 0; i < stride; i++) {
114 if ((q->pop_buffer(task) ||
115 q->pop_local(task) ||
|
73 ShenandoahConnectionMatrix* matrix = _heap->connection_matrix();
74 SCMObjToScanQueueSet* queues = _heap->partial_gc()->task_queues();
75 SCMObjToScanQueue* q = queues->queue(worker_id);
76
77 // Step 1: Process ordinary GC roots.
78 {
79 PartialEvacuateUpdateRootsClosure roots_cl(q);
80 CLDToOopClosure cld_cl(&roots_cl);
81 MarkingCodeBlobClosure code_cl(&roots_cl, CodeBlobToOopClosure::FixRelocations);
82 _rp->process_all_roots(&roots_cl, &roots_cl, &cld_cl, &code_cl, worker_id);
83 }
84 if (check_and_handle_cancelled_gc()) return;
85
86 PartialEvacuateUpdateHeapClosure cl(q);
87
88 // Step 2: Process all root regions.
89 {
90 ShenandoahHeapRegion* r = _root_regions->claim_next();
91 while (r != NULL) {
92 assert(r->is_root(), "must be root region");
93 _heap->marked_object_oop_iterate(r, &cl);
94 r->set_root(false);
95 if (check_and_handle_cancelled_gc()) return;
96 r = _root_regions->claim_next();
97 }
98 }
99 if (check_and_handle_cancelled_gc()) return;
100
101 // Step 3: Drain all outstanding work in queues.
102 {
103 int seed = 17;
104 SCMTask task;
105
106 uint stride = ShenandoahMarkLoopStride;
107
108 while (true) {
109 if (check_and_handle_cancelled_gc()) return;
110
111 for (uint i = 0; i < stride; i++) {
112 if ((q->pop_buffer(task) ||
113 q->pop_local(task) ||
|