src/hotspot/share/gc/z/zDriver.cpp
changeset 52382 2e280ecec246
parent 52140 3a168f782e80
child 52876 2d17750d41e7
equal deleted inserted replaced
52381:7f90bc64b0fc 52382:2e280ecec246
    31 #include "gc/z/zHeap.inline.hpp"
    31 #include "gc/z/zHeap.inline.hpp"
    32 #include "gc/z/zMessagePort.inline.hpp"
    32 #include "gc/z/zMessagePort.inline.hpp"
    33 #include "gc/z/zServiceability.hpp"
    33 #include "gc/z/zServiceability.hpp"
    34 #include "gc/z/zStat.hpp"
    34 #include "gc/z/zStat.hpp"
    35 #include "logging/log.hpp"
    35 #include "logging/log.hpp"
       
    36 #include "memory/universe.hpp"
    36 #include "runtime/vm_operations.hpp"
    37 #include "runtime/vm_operations.hpp"
    37 #include "runtime/vmThread.hpp"
    38 #include "runtime/vmThread.hpp"
    38 
    39 
    39 static const ZStatPhaseCycle      ZPhaseCycle("Garbage Collection Cycle");
    40 static const ZStatPhaseCycle      ZPhaseCycle("Garbage Collection Cycle");
    40 static const ZStatPhasePause      ZPhasePauseMarkStart("Pause Mark Start");
    41 static const ZStatPhasePause      ZPhasePauseMarkStart("Pause Mark Start");
    42 static const ZStatPhaseConcurrent ZPhaseConcurrentMarkContinue("Concurrent Mark Continue");
    43 static const ZStatPhaseConcurrent ZPhaseConcurrentMarkContinue("Concurrent Mark Continue");
    43 static const ZStatPhasePause      ZPhasePauseMarkEnd("Pause Mark End");
    44 static const ZStatPhasePause      ZPhasePauseMarkEnd("Pause Mark End");
    44 static const ZStatPhaseConcurrent ZPhaseConcurrentProcessNonStrongReferences("Concurrent Process Non-Strong References");
    45 static const ZStatPhaseConcurrent ZPhaseConcurrentProcessNonStrongReferences("Concurrent Process Non-Strong References");
    45 static const ZStatPhaseConcurrent ZPhaseConcurrentResetRelocationSet("Concurrent Reset Relocation Set");
    46 static const ZStatPhaseConcurrent ZPhaseConcurrentResetRelocationSet("Concurrent Reset Relocation Set");
    46 static const ZStatPhaseConcurrent ZPhaseConcurrentDestroyDetachedPages("Concurrent Destroy Detached Pages");
    47 static const ZStatPhaseConcurrent ZPhaseConcurrentDestroyDetachedPages("Concurrent Destroy Detached Pages");
       
    48 static const ZStatPhasePause      ZPhasePauseVerify("Pause Verify");
    47 static const ZStatPhaseConcurrent ZPhaseConcurrentSelectRelocationSet("Concurrent Select Relocation Set");
    49 static const ZStatPhaseConcurrent ZPhaseConcurrentSelectRelocationSet("Concurrent Select Relocation Set");
    48 static const ZStatPhaseConcurrent ZPhaseConcurrentPrepareRelocationSet("Concurrent Prepare Relocation Set");
    50 static const ZStatPhaseConcurrent ZPhaseConcurrentPrepareRelocationSet("Concurrent Prepare Relocation Set");
    49 static const ZStatPhasePause      ZPhasePauseRelocateStart("Pause Relocate Start");
    51 static const ZStatPhasePause      ZPhasePauseRelocateStart("Pause Relocate Start");
    50 static const ZStatPhaseConcurrent ZPhaseConcurrentRelocated("Concurrent Relocate");
    52 static const ZStatPhaseConcurrent ZPhaseConcurrentRelocated("Concurrent Relocate");
    51 static const ZStatCriticalPhase   ZCriticalPhaseGCLockerStall("GC Locker Stall", false /* verbose */);
    53 static const ZStatCriticalPhase   ZCriticalPhaseGCLockerStall("GC Locker Stall", false /* verbose */);
   205   virtual bool do_operation() {
   207   virtual bool do_operation() {
   206     ZStatTimer timer(ZPhasePauseMarkEnd);
   208     ZStatTimer timer(ZPhasePauseMarkEnd);
   207     ZServiceabilityMarkEndTracer tracer;
   209     ZServiceabilityMarkEndTracer tracer;
   208 
   210 
   209     return ZHeap::heap()->mark_end();
   211     return ZHeap::heap()->mark_end();
       
   212   }
       
   213 };
       
   214 
       
   215 class ZVerifyClosure : public ZOperationClosure {
       
   216 public:
       
   217   virtual const char* name() const {
       
   218     return "ZVerify";
       
   219   }
       
   220 
       
   221   virtual bool do_operation() {
       
   222     ZStatTimer timer(ZPhasePauseVerify);
       
   223     Universe::verify();
       
   224     return true;
   210   }
   225   }
   211 };
   226 };
   212 
   227 
   213 class ZRelocateStartClosure : public ZOperationClosure {
   228 class ZRelocateStartClosure : public ZOperationClosure {
   214 public:
   229 public:
   365   {
   380   {
   366     ZStatTimer timer(ZPhaseConcurrentDestroyDetachedPages);
   381     ZStatTimer timer(ZPhaseConcurrentDestroyDetachedPages);
   367     ZHeap::heap()->destroy_detached_pages();
   382     ZHeap::heap()->destroy_detached_pages();
   368   }
   383   }
   369 
   384 
   370   // Phase 7: Concurrent Select Relocation Set
   385   // Phase 7: Pause Verify
       
   386   if (VerifyBeforeGC || VerifyDuringGC || VerifyAfterGC) {
       
   387     ZVerifyClosure cl;
       
   388     vm_operation(&cl);
       
   389   }
       
   390 
       
   391   // Phase 8: Concurrent Select Relocation Set
   371   {
   392   {
   372     ZStatTimer timer(ZPhaseConcurrentSelectRelocationSet);
   393     ZStatTimer timer(ZPhaseConcurrentSelectRelocationSet);
   373     ZHeap::heap()->select_relocation_set();
   394     ZHeap::heap()->select_relocation_set();
   374   }
   395   }
   375 
   396 
   376   // Phase 8: Concurrent Prepare Relocation Set
   397   // Phase 9: Concurrent Prepare Relocation Set
   377   {
   398   {
   378     ZStatTimer timer(ZPhaseConcurrentPrepareRelocationSet);
   399     ZStatTimer timer(ZPhaseConcurrentPrepareRelocationSet);
   379     ZHeap::heap()->prepare_relocation_set();
   400     ZHeap::heap()->prepare_relocation_set();
   380   }
   401   }
   381 
   402 
   382   // Phase 9: Pause Relocate Start
   403   // Phase 10: Pause Relocate Start
   383   {
   404   {
   384     ZRelocateStartClosure cl;
   405     ZRelocateStartClosure cl;
   385     vm_operation(&cl);
   406     vm_operation(&cl);
   386   }
   407   }
   387 
   408 
   388   // Phase 10: Concurrent Relocate
   409   // Phase 11: Concurrent Relocate
   389   {
   410   {
   390     ZStatTimer timer(ZPhaseConcurrentRelocated);
   411     ZStatTimer timer(ZPhaseConcurrentRelocated);
   391     ZHeap::heap()->relocate();
   412     ZHeap::heap()->relocate();
   392   }
   413   }
   393 }
   414 }