< prev index next >

src/share/vm/gc_implementation/shared/vmGCOperations.cpp

Print this page




 111   // Check invocations
 112   if (skip_operation()) {
 113     // skip collection
 114     Heap_lock->unlock();
 115     release_and_notify_pending_list_lock();
 116     _prologue_succeeded = false;
 117   } else {
 118     _prologue_succeeded = true;
 119   }
 120   return _prologue_succeeded;
 121 }
 122 
 123 
 124 void VM_GC_Operation::doit_epilogue() {
 125   assert(Thread::current()->is_Java_thread(), "just checking");
 126   // Release the Heap_lock first.
 127   Heap_lock->unlock();
 128   release_and_notify_pending_list_lock();
 129 }
 130 
 131 bool VM_GC_HeapInspection::doit_prologue() {
 132   if (Universe::heap()->supports_heap_inspection()) {
 133     return VM_GC_Operation::doit_prologue();
 134   } else {
 135     return false;
 136   }
 137 }
 138 
 139 bool VM_GC_HeapInspection::skip_operation() const {
 140   assert(Universe::heap()->supports_heap_inspection(), "huh?");
 141   return false;
 142 }
 143 
 144 bool VM_GC_HeapInspection::collect() {
 145   if (GC_locker::is_active()) {
 146     return false;
 147   }
 148   Universe::heap()->collect_as_vm_thread(GCCause::_heap_inspection);
 149   return true;
 150 }
 151 
 152 void VM_GC_HeapInspection::doit() {
 153   HandleMark hm;
 154   Universe::heap()->ensure_parsability(false); // must happen, even if collection does
 155                                                // not happen (e.g. due to GC_locker)
 156                                                // or _full_gc being false
 157   if (_full_gc) {
 158     if (!collect()) {
 159       // The collection attempt was skipped because the gc locker is held.
 160       // The following dump may then be a tad misleading to someone expecting




 111   // Check invocations
 112   if (skip_operation()) {
 113     // skip collection
 114     Heap_lock->unlock();
 115     release_and_notify_pending_list_lock();
 116     _prologue_succeeded = false;
 117   } else {
 118     _prologue_succeeded = true;
 119   }
 120   return _prologue_succeeded;
 121 }
 122 
 123 
 124 void VM_GC_Operation::doit_epilogue() {
 125   assert(Thread::current()->is_Java_thread(), "just checking");
 126   // Release the Heap_lock first.
 127   Heap_lock->unlock();
 128   release_and_notify_pending_list_lock();
 129 }
 130 








 131 bool VM_GC_HeapInspection::skip_operation() const {

 132   return false;
 133 }
 134 
 135 bool VM_GC_HeapInspection::collect() {
 136   if (GC_locker::is_active()) {
 137     return false;
 138   }
 139   Universe::heap()->collect_as_vm_thread(GCCause::_heap_inspection);
 140   return true;
 141 }
 142 
 143 void VM_GC_HeapInspection::doit() {
 144   HandleMark hm;
 145   Universe::heap()->ensure_parsability(false); // must happen, even if collection does
 146                                                // not happen (e.g. due to GC_locker)
 147                                                // or _full_gc being false
 148   if (_full_gc) {
 149     if (!collect()) {
 150       // The collection attempt was skipped because the gc locker is held.
 151       // The following dump may then be a tad misleading to someone expecting


< prev index next >