3939// a set of operations (VM_Operation) related to GC.
4040//
4141// VM_Operation
42+ // VM_GC_Sync_Operation
4243// VM_GC_Operation
43- // VM_GC_HeapInspection
44- // VM_GenCollectFull
45- // VM_GenCollectFullConcurrent
46- // VM_ParallelGCSystemGC
47- // VM_CollectForAllocation
48- // VM_GenCollectForAllocation
49- // VM_ParallelGCFailedAllocation
44+ // VM_GC_HeapInspection
45+ // VM_PopulateDynamicDumpSharedSpace
46+ // VM_GenCollectFull
47+ // VM_GenCollectFullConcurrent
48+ // VM_ParallelGCSystemGC
49+ // VM_CollectForAllocation
50+ // VM_GenCollectForAllocation
51+ // VM_ParallelGCFailedAllocation
52+ // VM_Verify
53+ // VM_PopulateDumpSharedSpace
54+ //
55+ // VM_GC_Sync_Operation
56+ // - implements only synchronization with other VM operations of the
57+ // same kind using the Heap_lock, not actually doing a GC.
58+ //
5059// VM_GC_Operation
51- // - implements methods common to all classes in the hierarchy:
52- // prevents multiple gc requests and manages lock on heap;
60+ // - implements methods common to all operations that perform garbage collections,
61+ // checking that the VM is in a state to do GC and preventing multiple GC
62+ // requests.
5363//
5464// VM_GC_HeapInspection
5565// - prints class histogram on SIGBREAK if PrintClassHistogram
6878// - these operations preform full collection of heaps of
6979// different kind
7080//
81+ // VM_Verify
82+ // - verifies the heap
83+ //
84+ // VM_PopulateDynamicDumpSharedSpace
85+ // - populates the CDS archive area with the information from the archive file.
86+ //
87+ // VM_PopulateDumpSharedSpace
88+ // - creates the CDS archive
89+ //
90+
91+ class VM_GC_Sync_Operation : public VM_Operation {
92+ public:
93+
94+ VM_GC_Sync_Operation () : VM_Operation() { }
95+
96+ // Acquires the Heap_lock.
97+ virtual bool doit_prologue ();
98+ // Releases the Heap_lock.
99+ virtual void doit_epilogue ();
100+ };
101+
102+ class VM_Verify : public VM_GC_Sync_Operation {
103+ public:
104+ VMOp_Type type () const { return VMOp_Verify; }
105+ void doit ();
106+ };
71107
72- class VM_GC_Operation : public VM_Operation {
108+ class VM_GC_Operation : public VM_GC_Sync_Operation {
73109 protected:
74- uint _gc_count_before; // gc count before acquiring PLL
75- uint _full_gc_count_before; // full gc count before acquiring PLL
110+ uint _gc_count_before; // gc count before acquiring the Heap_lock
111+ uint _full_gc_count_before; // full gc count before acquiring the Heap_lock
76112 bool _full; // whether a "full" collection
77113 bool _prologue_succeeded; // whether doit_prologue succeeded
78114 GCCause::Cause _gc_cause; // the putative cause for this gc op
@@ -84,7 +120,7 @@ class VM_GC_Operation: public VM_Operation {
84120 VM_GC_Operation (uint gc_count_before,
85121 GCCause::Cause _cause,
86122 uint full_gc_count_before = 0 ,
87- bool full = false ) {
123+ bool full = false ) : VM_GC_Sync_Operation() {
88124 _full = full;
89125 _prologue_succeeded = false ;
90126 _gc_count_before = gc_count_before;
@@ -106,9 +142,10 @@ class VM_GC_Operation: public VM_Operation {
106142 }
107143 ~VM_GC_Operation ();
108144
109- // Acquire the reference synchronization lock
145+ // Acquire the Heap_lock and determine if this VM operation should be executed
146+ // (i.e. not skipped). Return this result, and also store it in _prologue_succeeded.
110147 virtual bool doit_prologue ();
111- // Do notifyAll ( if needed) and release held lock
148+ // Notify the Heap_lock if needed and release it.
112149 virtual void doit_epilogue ();
113150
114151 virtual bool allow_nested_vm_operations () const { return true ; }
0 commit comments