< prev index next >

src/hotspot/share/gc/g1/g1ConcurrentMark.cpp

Print this page

        

*** 46,55 **** --- 46,56 ---- #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/strongRootsScope.hpp" #include "gc/shared/taskqueue.inline.hpp" #include "gc/shared/vmGCOperations.hpp" + #include "gc/shared/weakProcessor.hpp" #include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.hpp"
*** 1601,1624 **** G1CollectedHeap* g1h = G1CollectedHeap::heap(); // Is alive closure. G1CMIsAliveClosure g1_is_alive(g1h); - // Inner scope to exclude the cleaning of the string and symbol - // tables from the displayed time. - { - GCTraceTime(Debug, gc, phases) trace("Reference Processing", _gc_timer_cm); - - ReferenceProcessor* rp = g1h->ref_processor_cm(); - - // See the comment in G1CollectedHeap::ref_processing_init() - // about how reference processing currently works in G1. - - // Set the soft reference policy - rp->setup_policy(clear_all_soft_refs); - assert(_global_mark_stack.is_empty(), "mark stack should be empty"); - // Instances of the 'Keep Alive' and 'Complete GC' closures used // in serial reference processing. Note these closures are also // used for serially processing (by the the current thread) the // JNI references during parallel reference processing. // --- 1602,1611 ----
*** 1632,1641 **** --- 1619,1642 ---- // their own instances of these closures, which do their own // synchronization among themselves. G1CMKeepAliveAndDrainClosure g1_keep_alive(this, task(0), true /* is_serial */); G1CMDrainMarkingStackClosure g1_drain_mark_stack(this, task(0), true /* is_serial */); + // Inner scope to exclude the cleaning of the string and symbol + // tables from the displayed time. + { + GCTraceTime(Debug, gc, phases) trace("Reference Processing", _gc_timer_cm); + + ReferenceProcessor* rp = g1h->ref_processor_cm(); + + // See the comment in G1CollectedHeap::ref_processing_init() + // about how reference processing currently works in G1. + + // Set the soft reference policy + rp->setup_policy(clear_all_soft_refs); + assert(_global_mark_stack.is_empty(), "mark stack should be empty"); + // We need at least one active thread. If reference processing // is not multi-threaded we use the current (VMThread) thread, // otherwise we use the work gang from the G1CollectedHeap and // we utilize all the worker threads we can. bool processing_is_mt = rp->processing_is_mt();
*** 1685,1694 **** --- 1686,1700 ---- pt.print_enqueue_phase(); assert(!rp->discovery_enabled(), "Post condition"); } + { + GCTraceTime(Debug, gc, phases) debug("Weak Processing", _gc_timer_cm); + WeakProcessor::weak_oops_do(&g1_is_alive, &g1_keep_alive, &g1_drain_mark_stack); + } + if (has_overflown()) { // We can not trust g1_is_alive if the marking stack overflowed return; }
< prev index next >