< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp

Print this page
rev 52753 : [backport] 8221435: Shenandoah should not mark through weak roots
Reviewed-by: rkennke, shade
rev 52754 : [backport] 8221629: Shenandoah: Cleanup class unloading logic
Reviewed-by: rkennke


  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #include "precompiled.hpp"
  25 
  26 #include "code/codeCache.hpp"
  27 #include "gc/shared/gcTraceTime.inline.hpp"
  28 #include "gc/shenandoah/shenandoahBrooksPointer.hpp"
  29 #include "gc/shenandoah/shenandoahConcurrentMark.inline.hpp"
  30 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
  31 #include "gc/shenandoah/shenandoahFreeSet.hpp"
  32 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
  33 #include "gc/shenandoah/shenandoahMarkCompact.hpp"
  34 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
  35 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  36 #include "gc/shenandoah/shenandoahHeuristics.hpp"
  37 #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
  38 #include "gc/shenandoah/shenandoahRootProcessor.hpp"
  39 #include "gc/shenandoah/shenandoahTraversalGC.hpp"
  40 #include "gc/shenandoah/shenandoahTaskqueue.inline.hpp"
  41 #include "gc/shenandoah/shenandoahUtils.hpp"
  42 #include "gc/shenandoah/shenandoahVerifier.hpp"
  43 #include "gc/shenandoah/shenandoahVMOperations.hpp"
  44 #include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
  45 #include "memory/metaspace.hpp"
  46 #include "oops/oop.inline.hpp"
  47 #include "runtime/thread.hpp"
  48 #include "utilities/copy.hpp"
  49 #include "utilities/growableArray.hpp"
  50 #include "gc/shared/workgroup.hpp"
  51 
  52 void ShenandoahMarkCompact::initialize(GCTimer* gc_timer) {
  53   _gc_timer = gc_timer;
  54 }
  55 
  56 void ShenandoahMarkCompact::do_it(GCCause::Cause gc_cause) {
  57   ShenandoahHeap* heap = ShenandoahHeap::heap();
  58 


 558       r = _regions.next();
 559     }
 560   }
 561 };
 562 
 563 class ShenandoahAdjustRootPointersTask : public AbstractGangTask {
 564 private:
 565   ShenandoahRootProcessor* _rp;
 566 
 567 public:
 568   ShenandoahAdjustRootPointersTask(ShenandoahRootProcessor* rp) :
 569     AbstractGangTask("Shenandoah Adjust Root Pointers Task"),
 570     _rp(rp) {}
 571 
 572   void work(uint worker_id) {
 573     ShenandoahAdjustPointersClosure cl;
 574     CLDToOopClosure adjust_cld_closure(&cl, true);
 575     MarkingCodeBlobClosure adjust_code_closure(&cl,
 576                                              CodeBlobToOopClosure::FixRelocations);
 577 
 578     _rp->process_all_roots(&cl, &cl,
 579                            &adjust_cld_closure,
 580                            &adjust_code_closure, NULL, worker_id);
 581   }
 582 };
 583 
 584 void ShenandoahMarkCompact::phase3_update_references() {
 585   GCTraceTime(Info, gc, phases) time("Phase 3: Adjust pointers", _gc_timer);
 586   ShenandoahGCPhase adjust_pointer_phase(ShenandoahPhaseTimings::full_gc_adjust_pointers);
 587 
 588   ShenandoahHeap* heap = ShenandoahHeap::heap();
 589 
 590   WorkGang* workers = heap->workers();
 591   uint nworkers = workers->active_workers();
 592   {
 593 #if COMPILER2_OR_JVMCI
 594     DerivedPointerTable::clear();
 595 #endif
 596     ShenandoahRootProcessor rp(heap, nworkers, ShenandoahPhaseTimings::full_gc_roots);
 597     ShenandoahAdjustRootPointersTask task(&rp);
 598     workers->run_task(&task);




  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #include "precompiled.hpp"
  25 
  26 #include "code/codeCache.hpp"
  27 #include "gc/shared/gcTraceTime.inline.hpp"
  28 #include "gc/shenandoah/shenandoahBrooksPointer.hpp"
  29 #include "gc/shenandoah/shenandoahConcurrentMark.inline.hpp"
  30 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
  31 #include "gc/shenandoah/shenandoahFreeSet.hpp"
  32 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
  33 #include "gc/shenandoah/shenandoahMarkCompact.hpp"
  34 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
  35 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  36 #include "gc/shenandoah/shenandoahHeuristics.hpp"
  37 #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
  38 #include "gc/shenandoah/shenandoahRootProcessor.inline.hpp"
  39 #include "gc/shenandoah/shenandoahTraversalGC.hpp"
  40 #include "gc/shenandoah/shenandoahTaskqueue.inline.hpp"
  41 #include "gc/shenandoah/shenandoahUtils.hpp"
  42 #include "gc/shenandoah/shenandoahVerifier.hpp"
  43 #include "gc/shenandoah/shenandoahVMOperations.hpp"
  44 #include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
  45 #include "memory/metaspace.hpp"
  46 #include "oops/oop.inline.hpp"
  47 #include "runtime/thread.hpp"
  48 #include "utilities/copy.hpp"
  49 #include "utilities/growableArray.hpp"
  50 #include "gc/shared/workgroup.hpp"
  51 
  52 void ShenandoahMarkCompact::initialize(GCTimer* gc_timer) {
  53   _gc_timer = gc_timer;
  54 }
  55 
  56 void ShenandoahMarkCompact::do_it(GCCause::Cause gc_cause) {
  57   ShenandoahHeap* heap = ShenandoahHeap::heap();
  58 


 558       r = _regions.next();
 559     }
 560   }
 561 };
 562 
 563 class ShenandoahAdjustRootPointersTask : public AbstractGangTask {
 564 private:
 565   ShenandoahRootProcessor* _rp;
 566 
 567 public:
 568   ShenandoahAdjustRootPointersTask(ShenandoahRootProcessor* rp) :
 569     AbstractGangTask("Shenandoah Adjust Root Pointers Task"),
 570     _rp(rp) {}
 571 
 572   void work(uint worker_id) {
 573     ShenandoahAdjustPointersClosure cl;
 574     CLDToOopClosure adjust_cld_closure(&cl, true);
 575     MarkingCodeBlobClosure adjust_code_closure(&cl,
 576                                              CodeBlobToOopClosure::FixRelocations);
 577 
 578     _rp->update_all_roots<AlwaysTrueClosure>(&cl,
 579                                              &adjust_cld_closure,
 580                                              &adjust_code_closure, NULL, worker_id);
 581   }
 582 };
 583 
 584 void ShenandoahMarkCompact::phase3_update_references() {
 585   GCTraceTime(Info, gc, phases) time("Phase 3: Adjust pointers", _gc_timer);
 586   ShenandoahGCPhase adjust_pointer_phase(ShenandoahPhaseTimings::full_gc_adjust_pointers);
 587 
 588   ShenandoahHeap* heap = ShenandoahHeap::heap();
 589 
 590   WorkGang* workers = heap->workers();
 591   uint nworkers = workers->active_workers();
 592   {
 593 #if COMPILER2_OR_JVMCI
 594     DerivedPointerTable::clear();
 595 #endif
 596     ShenandoahRootProcessor rp(heap, nworkers, ShenandoahPhaseTimings::full_gc_roots);
 597     ShenandoahAdjustRootPointersTask task(&rp);
 598     workers->run_task(&task);


< prev index next >