1115 _secondary_free_list.add_ordered(list); 1116 } 1117 1118 void append_secondary_free_list() { 1119 _hrm.insert_list_into_free_list(&_secondary_free_list); 1120 } 1121 1122 void append_secondary_free_list_if_not_empty_with_lock() { 1123 // If the secondary free list looks empty there's no reason to 1124 // take the lock and then try to append it. 1125 if (!_secondary_free_list.is_empty()) { 1126 MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag); 1127 append_secondary_free_list(); 1128 } 1129 } 1130 1131 inline void old_set_add(HeapRegion* hr); 1132 inline void old_set_remove(HeapRegion* hr); 1133 1134 size_t non_young_capacity_bytes() { 1135 return _old_set.total_capacity_bytes() + _humongous_set.total_capacity_bytes(); 1136 } 1137 1138 void set_free_regions_coming(); 1139 void reset_free_regions_coming(); 1140 bool free_regions_coming() { return _free_regions_coming; } 1141 void wait_while_free_regions_coming(); 1142 1143 // Determine whether the given region is one that we are using as an 1144 // old GC alloc region. 1145 bool is_old_gc_alloc_region(HeapRegion* hr); 1146 1147 // Perform a collection of the heap; intended for use in implementing 1148 // "System.gc". This probably implies as full a collection as the 1149 // "CollectedHeap" supports. 1150 virtual void collect(GCCause::Cause cause); 1151 1152 virtual bool copy_allocation_context_stats(const jint* contexts, 1153 jlong* totals, 1154 jbyte* accuracy, 1155 jint len); 1156 1157 // True iff an evacuation has failed in the most-recent collection. 1158 bool evacuation_failed() { return _evacuation_failed; } 1159 1160 void remove_from_old_sets(const HeapRegionSetCount& old_regions_removed, const HeapRegionSetCount& humongous_regions_removed); 1161 void prepend_to_freelist(FreeRegionList* list); 1162 void decrement_summary_bytes(size_t bytes); 1163 1164 virtual bool is_in(const void* p) const; 1165 #ifdef ASSERT 1166 // Returns whether p is in one of the available areas of the heap. Slow but 1167 // extensive version. 1168 bool is_in_exact(const void* p) const; 1169 #endif 1170 1171 // Return "TRUE" iff the given object address is within the collection 1172 // set. Slow implementation. 1173 bool obj_in_cs(oop obj); 1174 1175 inline bool is_in_cset(const HeapRegion *hr); 1176 inline bool is_in_cset(oop obj); 1177 1178 inline bool is_in_cset_or_humongous(const oop obj); 1179 1180 private: | 1115 _secondary_free_list.add_ordered(list); 1116 } 1117 1118 void append_secondary_free_list() { 1119 _hrm.insert_list_into_free_list(&_secondary_free_list); 1120 } 1121 1122 void append_secondary_free_list_if_not_empty_with_lock() { 1123 // If the secondary free list looks empty there's no reason to 1124 // take the lock and then try to append it. 1125 if (!_secondary_free_list.is_empty()) { 1126 MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag); 1127 append_secondary_free_list(); 1128 } 1129 } 1130 1131 inline void old_set_add(HeapRegion* hr); 1132 inline void old_set_remove(HeapRegion* hr); 1133 1134 size_t non_young_capacity_bytes() { 1135 return (_old_set.length() + _humongous_set.length()) * HeapRegion::GrainBytes; 1136 } 1137 1138 void set_free_regions_coming(); 1139 void reset_free_regions_coming(); 1140 bool free_regions_coming() { return _free_regions_coming; } 1141 void wait_while_free_regions_coming(); 1142 1143 // Determine whether the given region is one that we are using as an 1144 // old GC alloc region. 1145 bool is_old_gc_alloc_region(HeapRegion* hr); 1146 1147 // Perform a collection of the heap; intended for use in implementing 1148 // "System.gc". This probably implies as full a collection as the 1149 // "CollectedHeap" supports. 1150 virtual void collect(GCCause::Cause cause); 1151 1152 virtual bool copy_allocation_context_stats(const jint* contexts, 1153 jlong* totals, 1154 jbyte* accuracy, 1155 jint len); 1156 1157 // True iff an evacuation has failed in the most-recent collection. 1158 bool evacuation_failed() { return _evacuation_failed; } 1159 1160 void remove_from_old_sets(const uint old_regions_removed, const uint humongous_regions_removed); 1161 void prepend_to_freelist(FreeRegionList* list); 1162 void decrement_summary_bytes(size_t bytes); 1163 1164 virtual bool is_in(const void* p) const; 1165 #ifdef ASSERT 1166 // Returns whether p is in one of the available areas of the heap. Slow but 1167 // extensive version. 1168 bool is_in_exact(const void* p) const; 1169 #endif 1170 1171 // Return "TRUE" iff the given object address is within the collection 1172 // set. Slow implementation. 1173 bool obj_in_cs(oop obj); 1174 1175 inline bool is_in_cset(const HeapRegion *hr); 1176 inline bool is_in_cset(oop obj); 1177 1178 inline bool is_in_cset_or_humongous(const oop obj); 1179 1180 private: |