src/hotspot/share/gc/g1/g1MarkSweep.cpp
changeset 47648 226b1fc611b9
parent 47216 71c04702a3d5
child 47676 b1c020fc35a3
equal deleted inserted replaced
47646:c20cc2d3aa39 47648:226b1fc611b9
    41 #include "gc/shared/gcTraceTime.inline.hpp"
    41 #include "gc/shared/gcTraceTime.inline.hpp"
    42 #include "gc/shared/genCollectedHeap.hpp"
    42 #include "gc/shared/genCollectedHeap.hpp"
    43 #include "gc/shared/modRefBarrierSet.hpp"
    43 #include "gc/shared/modRefBarrierSet.hpp"
    44 #include "gc/shared/referencePolicy.hpp"
    44 #include "gc/shared/referencePolicy.hpp"
    45 #include "gc/shared/space.hpp"
    45 #include "gc/shared/space.hpp"
       
    46 #include "gc/shared/weakProcessor.hpp"
    46 #include "oops/instanceRefKlass.hpp"
    47 #include "oops/instanceRefKlass.hpp"
    47 #include "oops/oop.inline.hpp"
    48 #include "oops/oop.inline.hpp"
    48 #include "prims/jvmtiExport.hpp"
    49 #include "prims/jvmtiExport.hpp"
    49 #include "runtime/atomic.hpp"
    50 #include "runtime/atomic.hpp"
    50 #include "runtime/biasedLocking.hpp"
    51 #include "runtime/biasedLocking.hpp"
   177                                           &GenMarkSweep::follow_stack_closure,
   178                                           &GenMarkSweep::follow_stack_closure,
   178                                           NULL,
   179                                           NULL,
   179                                           &pt);
   180                                           &pt);
   180     gc_tracer()->report_gc_reference_stats(stats);
   181     gc_tracer()->report_gc_reference_stats(stats);
   181     pt.print_all_references();
   182     pt.print_all_references();
       
   183   }
       
   184 
       
   185   {
       
   186     GCTraceTime(Debug, gc, phases) trace("Weak Processing", gc_timer());
       
   187     WeakProcessor::weak_oops_do(&GenMarkSweep::is_alive,
       
   188                                 &GenMarkSweep::keep_alive,
       
   189                                 &GenMarkSweep::follow_stack_closure);
   182   }
   190   }
   183 
   191 
   184   // This is the point where the entire marking should have completed.
   192   // This is the point where the entire marking should have completed.
   185   assert(GenMarkSweep::_marking_stack.is_empty(), "Marking should have completed");
   193   assert(GenMarkSweep::_marking_stack.is_empty(), "Marking should have completed");
   186 
   194 
   270   assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
   278   assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
   271   g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
   279   g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
   272 
   280 
   273   // Now adjust pointers in remaining weak roots.  (All of which should
   281   // Now adjust pointers in remaining weak roots.  (All of which should
   274   // have been cleared if they pointed to non-surviving objects.)
   282   // have been cleared if they pointed to non-surviving objects.)
   275   JNIHandles::weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
   283   WeakProcessor::oops_do(&GenMarkSweep::adjust_pointer_closure);
   276 
   284 
   277   if (G1StringDedup::is_enabled()) {
   285   if (G1StringDedup::is_enabled()) {
   278     G1StringDedup::oops_do(&GenMarkSweep::adjust_pointer_closure);
   286     G1StringDedup::oops_do(&GenMarkSweep::adjust_pointer_closure);
   279   }
   287   }
   280 
   288