< prev index next >

src/hotspot/share/gc/shenandoah/vm_operations_shenandoah.hpp

Print this page
rev 50076 : Fold Partial GC into Traversal GC


  20  * questions.
  21  *
  22  */
  23 
  24 #ifndef SHARE_VM_GC_SHENANDOAH_VM_OPERATIONS_SHENANDOAH_HPP
  25 #define SHARE_VM_GC_SHENANDOAH_VM_OPERATIONS_SHENANDOAH_HPP
  26 
  27 #include "gc/shenandoah/shenandoahConcurrentMark.hpp"
  28 #include "gc/shared/vmGCOperations.hpp"
  29 
  30 // VM_operations for the Shenandoah Collector.
  31 //
  32 // VM_ShenandoahOperation
  33 //   - VM_ShenandoahInitMark: initiate concurrent marking
  34 //   - VM_ShenandoahReferenceOperation:
  35 //       - VM_ShenandoahFinalMarkStartEvac: finish up concurrent marking, and start evacuation
  36 //       - VM_ShenandoahFinalEvac: finish concurrent evacuation
  37 //       - VM_ShenandoahInitUpdateRefs: initiate update references
  38 //       - VM_ShenandoahFinalUpdateRefs: finish up update references
  39 //       - VM_ShenandoahFullGC: do full GC
  40 //       - VM_ShenandoahInitPartialGC: init partial GC
  41 //       - VM_ShenandoahFinalPartialGC: finish partial GC
  42 //       - VM_ShenandoahInitTraversalGC: init traversal GC
  43 //       - VM_ShenandoahFinalTraversalGC: finish traversal GC
  44 
  45 class VM_ShenandoahOperation : public VM_Operation {
  46 protected:
  47   uint         _gc_id;
  48 public:
  49   bool _safepoint_cleanup_done;
  50   VM_ShenandoahOperation() : _gc_id(GCId::current()), _safepoint_cleanup_done(false) {};
  51   virtual bool deflates_idle_monitors() { return ShenandoahMergeSafepointCleanup && ! _safepoint_cleanup_done; }
  52   virtual bool marks_nmethods() { return ShenandoahMergeSafepointCleanup && ! _safepoint_cleanup_done; }
  53 };
  54 
  55 class VM_ShenandoahReferenceOperation : public VM_ShenandoahOperation {
  56 public:
  57   VM_ShenandoahReferenceOperation() : VM_ShenandoahOperation() {};
  58   bool doit_prologue();
  59   void doit_epilogue();
  60 };
  61 


  98 
  99   // Degenerate GC may be upgraded to Full GC, and therefore we need to block deflation and
 100   // marking, as VM_ShenandoahFullGC does.
 101   bool deflates_idle_monitors() { return false; }
 102   bool marks_nmethods() { return false; }
 103 };
 104 
 105 class VM_ShenandoahFullGC : public VM_ShenandoahReferenceOperation {
 106 private:
 107   GCCause::Cause _gc_cause;
 108 public:
 109   VM_ShenandoahFullGC(GCCause::Cause gc_cause) : VM_ShenandoahReferenceOperation(), _gc_cause(gc_cause) {};
 110   VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFullGC; }
 111   const char* name()             const { return "Shenandoah Full GC"; }
 112   virtual void doit();
 113   // Full-GC cannot deflate monitors and mark nmethods, because it installs a speciall BarrierSet
 114   // that disables read-barriers. However, the monitor and nmethod code requires read-barriers
 115   // to work correctly.
 116   bool deflates_idle_monitors() { return false; }
 117   bool marks_nmethods() { return false; }
 118 };
 119 
 120 class VM_ShenandoahInitPartialGC: public VM_ShenandoahOperation {
 121 public:
 122   VM_ShenandoahInitPartialGC() : VM_ShenandoahOperation() {};
 123   VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahInitPartialGC; }
 124   const char* name()             const { return "Shenandoah Init Partial Collection"; }
 125   virtual void doit();
 126 };
 127 
 128 class VM_ShenandoahFinalPartialGC: public VM_ShenandoahOperation {
 129 public:
 130   VM_ShenandoahFinalPartialGC() : VM_ShenandoahOperation() {};
 131   VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFinalPartialGC; }
 132   const char* name()             const { return "Shenandoah Final Partial Collection"; }
 133   virtual void doit();
 134 };
 135 
 136 class VM_ShenandoahInitTraversalGC: public VM_ShenandoahOperation {
 137 public:
 138   VM_ShenandoahInitTraversalGC() : VM_ShenandoahOperation() {};
 139   VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahInitTraversalGC; }
 140   const char* name()             const { return "Shenandoah Init Traversal Collection"; }
 141   virtual void doit();
 142 };
 143 
 144 class VM_ShenandoahFinalTraversalGC: public VM_ShenandoahReferenceOperation {
 145 public:
 146   VM_ShenandoahFinalTraversalGC() : VM_ShenandoahReferenceOperation() {};
 147   VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFinalTraversalGC; }
 148   const char* name()             const { return "Shenandoah Final Traversal Collection"; }
 149   virtual void doit();
 150 };
 151 
 152 class VM_ShenandoahInitUpdateRefs: public VM_ShenandoahOperation {
 153 public:


  20  * questions.
  21  *
  22  */
  23 
  24 #ifndef SHARE_VM_GC_SHENANDOAH_VM_OPERATIONS_SHENANDOAH_HPP
  25 #define SHARE_VM_GC_SHENANDOAH_VM_OPERATIONS_SHENANDOAH_HPP
  26 
  27 #include "gc/shenandoah/shenandoahConcurrentMark.hpp"
  28 #include "gc/shared/vmGCOperations.hpp"
  29 
  30 // VM_operations for the Shenandoah Collector.
  31 //
  32 // VM_ShenandoahOperation
  33 //   - VM_ShenandoahInitMark: initiate concurrent marking
  34 //   - VM_ShenandoahReferenceOperation:
  35 //       - VM_ShenandoahFinalMarkStartEvac: finish up concurrent marking, and start evacuation
  36 //       - VM_ShenandoahFinalEvac: finish concurrent evacuation
  37 //       - VM_ShenandoahInitUpdateRefs: initiate update references
  38 //       - VM_ShenandoahFinalUpdateRefs: finish up update references
  39 //       - VM_ShenandoahFullGC: do full GC


  40 //       - VM_ShenandoahInitTraversalGC: init traversal GC
  41 //       - VM_ShenandoahFinalTraversalGC: finish traversal GC
  42 
  43 class VM_ShenandoahOperation : public VM_Operation {
  44 protected:
  45   uint         _gc_id;
  46 public:
  47   bool _safepoint_cleanup_done;
  48   VM_ShenandoahOperation() : _gc_id(GCId::current()), _safepoint_cleanup_done(false) {};
  49   virtual bool deflates_idle_monitors() { return ShenandoahMergeSafepointCleanup && ! _safepoint_cleanup_done; }
  50   virtual bool marks_nmethods() { return ShenandoahMergeSafepointCleanup && ! _safepoint_cleanup_done; }
  51 };
  52 
  53 class VM_ShenandoahReferenceOperation : public VM_ShenandoahOperation {
  54 public:
  55   VM_ShenandoahReferenceOperation() : VM_ShenandoahOperation() {};
  56   bool doit_prologue();
  57   void doit_epilogue();
  58 };
  59 


  96 
  97   // Degenerate GC may be upgraded to Full GC, and therefore we need to block deflation and
  98   // marking, as VM_ShenandoahFullGC does.
  99   bool deflates_idle_monitors() { return false; }
 100   bool marks_nmethods() { return false; }
 101 };
 102 
 103 class VM_ShenandoahFullGC : public VM_ShenandoahReferenceOperation {
 104 private:
 105   GCCause::Cause _gc_cause;
 106 public:
 107   VM_ShenandoahFullGC(GCCause::Cause gc_cause) : VM_ShenandoahReferenceOperation(), _gc_cause(gc_cause) {};
 108   VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFullGC; }
 109   const char* name()             const { return "Shenandoah Full GC"; }
 110   virtual void doit();
 111   // Full-GC cannot deflate monitors and mark nmethods, because it installs a speciall BarrierSet
 112   // that disables read-barriers. However, the monitor and nmethod code requires read-barriers
 113   // to work correctly.
 114   bool deflates_idle_monitors() { return false; }
 115   bool marks_nmethods() { return false; }
















 116 };
 117 
 118 class VM_ShenandoahInitTraversalGC: public VM_ShenandoahOperation {
 119 public:
 120   VM_ShenandoahInitTraversalGC() : VM_ShenandoahOperation() {};
 121   VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahInitTraversalGC; }
 122   const char* name()             const { return "Shenandoah Init Traversal Collection"; }
 123   virtual void doit();
 124 };
 125 
 126 class VM_ShenandoahFinalTraversalGC: public VM_ShenandoahReferenceOperation {
 127 public:
 128   VM_ShenandoahFinalTraversalGC() : VM_ShenandoahReferenceOperation() {};
 129   VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFinalTraversalGC; }
 130   const char* name()             const { return "Shenandoah Final Traversal Collection"; }
 131   virtual void doit();
 132 };
 133 
 134 class VM_ShenandoahInitUpdateRefs: public VM_ShenandoahOperation {
 135 public:
< prev index next >