< prev index next >
src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp
Print this page
*** 241,252 ****
ReferenceProcessor* rp = NULL;
if (process_refs) {
rp = _heap->ref_processor();
}
! // Step 1: Process ordinary GC roots.
ShenandoahTraversalSATBBufferClosure satb_cl(q);
if (!_heap->is_degenerated_gc_in_progress()) {
ShenandoahTraversalClosure roots_cl(q, rp);
CLDToOopClosure cld_cl(&roots_cl);
MarkingCodeBlobClosure code_cl(&roots_cl, CodeBlobToOopClosure::FixRelocations);
ShenandoahTraversalSATBThreadsClosure tc(&satb_cl);
--- 241,261 ----
ReferenceProcessor* rp = NULL;
if (process_refs) {
rp = _heap->ref_processor();
}
! // Step 0: Drain outstanding SATB queues.
! // NOTE: we piggy-back draining of remaining thread SATB buffers on the final root scan below.
ShenandoahTraversalSATBBufferClosure satb_cl(q);
+ {
+ // Process remaining finished SATB buffers.
+ SATBMarkQueueSet& satb_mq_set = ShenandoahBarrierSet::satb_mark_queue_set();
+ while (satb_mq_set.apply_closure_to_completed_buffer(&satb_cl));
+ // Process remaining threads SATB buffers below.
+ }
+
+ // Step 1: Process ordinary GC roots.
if (!_heap->is_degenerated_gc_in_progress()) {
ShenandoahTraversalClosure roots_cl(q, rp);
CLDToOopClosure cld_cl(&roots_cl);
MarkingCodeBlobClosure code_cl(&roots_cl, CodeBlobToOopClosure::FixRelocations);
ShenandoahTraversalSATBThreadsClosure tc(&satb_cl);
< prev index next >