123 Heap_lock->unlock();
124 _prologue_succeeded = false;
125 } else {
126 _prologue_succeeded = true;
127 }
128 return _prologue_succeeded;
129 }
130
131
132 void VM_GC_Operation::doit_epilogue() {
133 // GC thread root traversal likely used OopMapCache a lot, which
134 // might have created lots of old entries. Trigger the cleanup now.
135 OopMapCache::try_trigger_cleanup();
136 if (Universe::has_reference_pending_list()) {
137 Heap_lock->notify_all();
138 }
139 VM_GC_Sync_Operation::doit_epilogue();
140 }
141
142 bool VM_GC_HeapInspection::doit_prologue() {
143 if (_full_gc && UseZGC) {
144 // ZGC cannot perform a synchronous GC cycle from within the VM thread.
145 // So VM_GC_HeapInspection::collect() is a noop. To respect the _full_gc
146 // flag a synchronous GC cycle is performed from the caller thread in the
147 // prologue.
148 Universe::heap()->collect(GCCause::_heap_inspection);
149 }
150 return VM_GC_Operation::doit_prologue();
151 }
152
153 bool VM_GC_HeapInspection::skip_operation() const {
154 return false;
155 }
156
157 bool VM_GC_HeapInspection::collect() {
158 if (GCLocker::is_active()) {
159 return false;
160 }
161 Universe::heap()->collect_as_vm_thread(GCCause::_heap_inspection);
162 return true;
163 }
164
|
123 Heap_lock->unlock();
124 _prologue_succeeded = false;
125 } else {
126 _prologue_succeeded = true;
127 }
128 return _prologue_succeeded;
129 }
130
131
132 void VM_GC_Operation::doit_epilogue() {
133 // GC thread root traversal likely used OopMapCache a lot, which
134 // might have created lots of old entries. Trigger the cleanup now.
135 OopMapCache::try_trigger_cleanup();
136 if (Universe::has_reference_pending_list()) {
137 Heap_lock->notify_all();
138 }
139 VM_GC_Sync_Operation::doit_epilogue();
140 }
141
142 bool VM_GC_HeapInspection::doit_prologue() {
143 if (_full_gc && (UseZGC || UseShenandoahGC)) {
144 // ZGC and Shenandoah cannot perform a synchronous GC cycle from within the VM thread.
145 // So VM_GC_HeapInspection::collect() is a noop. To respect the _full_gc
146 // flag a synchronous GC cycle is performed from the caller thread in the
147 // prologue.
148 Universe::heap()->collect(GCCause::_heap_inspection);
149 }
150 return VM_GC_Operation::doit_prologue();
151 }
152
153 bool VM_GC_HeapInspection::skip_operation() const {
154 return false;
155 }
156
157 bool VM_GC_HeapInspection::collect() {
158 if (GCLocker::is_active()) {
159 return false;
160 }
161 Universe::heap()->collect_as_vm_thread(GCCause::_heap_inspection);
162 return true;
163 }
164
|