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
60 class VM_ShenandoahInitMark: public VM_ShenandoahOperation {
61 public:
62 VM_ShenandoahInitMark() : VM_ShenandoahOperation() {};
63 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahInitMark; }
64 const char* name() const { return "Shenandoah Init Marking"; }
65 virtual void doit();
66 };
67
68 class VM_ShenandoahFinalMarkStartEvac: public VM_ShenandoahReferenceOperation {
69 public:
70 VM_ShenandoahFinalMarkStartEvac() : VM_ShenandoahReferenceOperation() {};
71 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFinalMarkStartEvac; }
72 const char* name() const { return "Shenandoah Final Mark and Start Evacuation"; }
73 virtual void doit();
74 };
75
76 class VM_ShenandoahFinalEvac: public VM_ShenandoahOperation {
77 public:
78 VM_ShenandoahFinalEvac() : VM_ShenandoahOperation() {};
79 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFinalEvac; }
80 const char* name() const { return "Shenandoah Final Evacuation"; }
81 virtual void doit();
82 bool deflates_idle_monitors() { return false; }
83 bool marks_nmethods() { return false; }
84 };
85
86 class VM_ShenandoahDegeneratedGC: public VM_ShenandoahReferenceOperation {
87 private:
88 // Really the ShenandoahHeap::ShenandoahDegenerationPoint, but casted to int here
89 // in order to avoid dependency on ShenandoahHeap
90 int _point;
91 public:
92 VM_ShenandoahDegeneratedGC(int point) : VM_ShenandoahReferenceOperation(), _point(point) {};
93 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahDegeneratedGC; }
94 const char* name() const { return "Shenandoah Degenerated GC"; }
95 virtual void doit();
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:
136 VM_ShenandoahInitUpdateRefs() : VM_ShenandoahOperation() {};
137 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahInitUpdateRefs; }
138 const char* name() const { return "Shenandoah Init Update References"; }
139 virtual void doit();
140 // We cannot deflate monitors and mark nmethods here, because it doesn't scan roots.
141 bool deflates_idle_monitors() { return false; }
142 bool marks_nmethods() { return false; }
143 };
144
145 class VM_ShenandoahFinalUpdateRefs: public VM_ShenandoahOperation {
146 public:
147 VM_ShenandoahFinalUpdateRefs() : VM_ShenandoahOperation() {};
148 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFinalUpdateRefs; }
149 const char* name() const { return "Shenandoah Final Update References"; }
150 virtual void doit();
151 };
152
153 #endif //SHARE_VM_GC_SHENANDOAH_VM_OPERATIONS_SHENANDOAH_HPP
|
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 VM_ShenandoahOperation() : _gc_id(GCId::current()) {};
48 };
49
50 class VM_ShenandoahReferenceOperation : public VM_ShenandoahOperation {
51 public:
52 VM_ShenandoahReferenceOperation() : VM_ShenandoahOperation() {};
53 bool doit_prologue();
54 void doit_epilogue();
55 };
56
57 class VM_ShenandoahInitMark: public VM_ShenandoahOperation {
58 public:
59 VM_ShenandoahInitMark() : VM_ShenandoahOperation() {};
60 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahInitMark; }
61 const char* name() const { return "Shenandoah Init Marking"; }
62 virtual void doit();
63 };
64
65 class VM_ShenandoahFinalMarkStartEvac: public VM_ShenandoahReferenceOperation {
66 public:
67 VM_ShenandoahFinalMarkStartEvac() : VM_ShenandoahReferenceOperation() {};
68 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFinalMarkStartEvac; }
69 const char* name() const { return "Shenandoah Final Mark and Start Evacuation"; }
70 virtual void doit();
71 };
72
73 class VM_ShenandoahFinalEvac: public VM_ShenandoahOperation {
74 public:
75 VM_ShenandoahFinalEvac() : VM_ShenandoahOperation() {};
76 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFinalEvac; }
77 const char* name() const { return "Shenandoah Final Evacuation"; }
78 virtual void doit();
79 };
80
81 class VM_ShenandoahDegeneratedGC: public VM_ShenandoahReferenceOperation {
82 private:
83 // Really the ShenandoahHeap::ShenandoahDegenerationPoint, but casted to int here
84 // in order to avoid dependency on ShenandoahHeap
85 int _point;
86 public:
87 VM_ShenandoahDegeneratedGC(int point) : VM_ShenandoahReferenceOperation(), _point(point) {};
88 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahDegeneratedGC; }
89 const char* name() const { return "Shenandoah Degenerated GC"; }
90 virtual void doit();
91 };
92
93 class VM_ShenandoahFullGC : public VM_ShenandoahReferenceOperation {
94 private:
95 GCCause::Cause _gc_cause;
96 public:
97 VM_ShenandoahFullGC(GCCause::Cause gc_cause) : VM_ShenandoahReferenceOperation(), _gc_cause(gc_cause) {};
98 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFullGC; }
99 const char* name() const { return "Shenandoah Full GC"; }
100 virtual void doit();
101 };
102
103 class VM_ShenandoahInitTraversalGC: public VM_ShenandoahOperation {
104 public:
105 VM_ShenandoahInitTraversalGC() : VM_ShenandoahOperation() {};
106 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahInitTraversalGC; }
107 const char* name() const { return "Shenandoah Init Traversal Collection"; }
108 virtual void doit();
109 };
110
111 class VM_ShenandoahFinalTraversalGC: public VM_ShenandoahReferenceOperation {
112 public:
113 VM_ShenandoahFinalTraversalGC() : VM_ShenandoahReferenceOperation() {};
114 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFinalTraversalGC; }
115 const char* name() const { return "Shenandoah Final Traversal Collection"; }
116 virtual void doit();
117 };
118
119 class VM_ShenandoahInitUpdateRefs: public VM_ShenandoahOperation {
120 public:
121 VM_ShenandoahInitUpdateRefs() : VM_ShenandoahOperation() {};
122 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahInitUpdateRefs; }
123 const char* name() const { return "Shenandoah Init Update References"; }
124 virtual void doit();
125 };
126
127 class VM_ShenandoahFinalUpdateRefs: public VM_ShenandoahOperation {
128 public:
129 VM_ShenandoahFinalUpdateRefs() : VM_ShenandoahOperation() {};
130 VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFinalUpdateRefs; }
131 const char* name() const { return "Shenandoah Final Update References"; }
132 virtual void doit();
133 };
134
135 #endif //SHARE_VM_GC_SHENANDOAH_VM_OPERATIONS_SHENANDOAH_HPP
|