99 vm_exit_during_initialization( 100 err_msg("GC triggered before VM initialization completed. Try increasing " 101 "NewSize, current value " SIZE_FORMAT "%s.", 102 byte_size_in_proper_unit(NewSize), 103 proper_unit_for_byte_size(NewSize))); 104 } 105 106 acquire_pending_list_lock(); 107 // If the GC count has changed someone beat us to the collection 108 // Get the Heap_lock after the pending_list_lock. 109 Heap_lock->lock(); 110 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 SharedHeap* sh = SharedHeap::heap(); 120 if (sh != NULL) sh->_thread_holds_heap_lock_for_gc = true; 121 } 122 return _prologue_succeeded; 123 } 124 125 126 void VM_GC_Operation::doit_epilogue() { 127 assert(Thread::current()->is_Java_thread(), "just checking"); 128 // Release the Heap_lock first. 129 SharedHeap* sh = SharedHeap::heap(); 130 if (sh != NULL) sh->_thread_holds_heap_lock_for_gc = false; 131 Heap_lock->unlock(); 132 release_and_notify_pending_list_lock(); 133 } 134 135 bool VM_GC_HeapInspection::doit_prologue() { 136 if (Universe::heap()->supports_heap_inspection()) { 137 return VM_GC_Operation::doit_prologue(); 138 } else { 139 return false; 140 } 141 } 142 143 bool VM_GC_HeapInspection::skip_operation() const { 144 assert(Universe::heap()->supports_heap_inspection(), "huh?"); 145 return false; 146 } 147 148 bool VM_GC_HeapInspection::collect() { 149 if (GC_locker::is_active()) { 150 return false; | 99 vm_exit_during_initialization( 100 err_msg("GC triggered before VM initialization completed. Try increasing " 101 "NewSize, current value " SIZE_FORMAT "%s.", 102 byte_size_in_proper_unit(NewSize), 103 proper_unit_for_byte_size(NewSize))); 104 } 105 106 acquire_pending_list_lock(); 107 // If the GC count has changed someone beat us to the collection 108 // Get the Heap_lock after the pending_list_lock. 109 Heap_lock->lock(); 110 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; |