187 }
188
189 HeapWord* G1Allocator::survivor_attempt_allocation(size_t min_word_size,
190 size_t desired_word_size,
191 size_t* actual_word_size) {
192 assert(!_g1h->is_humongous(desired_word_size),
193 "we should not be seeing humongous-size allocations in this path");
194
195 HeapWord* result = survivor_gc_alloc_region()->attempt_allocation(min_word_size,
196 desired_word_size,
197 actual_word_size);
198 if (result == NULL && !survivor_is_full()) {
199 MutexLocker x(FreeList_lock, Mutex::_no_safepoint_check_flag);
200 result = survivor_gc_alloc_region()->attempt_allocation_locked(min_word_size,
201 desired_word_size,
202 actual_word_size);
203 if (result == NULL) {
204 set_survivor_full();
205 }
206 }
207 if (result != NULL) {
208 _g1h->dirty_young_block(result, *actual_word_size);
209 }
210 return result;
211 }
212
213 HeapWord* G1Allocator::old_attempt_allocation(size_t min_word_size,
214 size_t desired_word_size,
215 size_t* actual_word_size) {
216 assert(!_g1h->is_humongous(desired_word_size),
217 "we should not be seeing humongous-size allocations in this path");
218
219 HeapWord* result = old_gc_alloc_region()->attempt_allocation(min_word_size,
220 desired_word_size,
221 actual_word_size);
222 if (result == NULL && !old_is_full()) {
223 MutexLocker x(FreeList_lock, Mutex::_no_safepoint_check_flag);
224 result = old_gc_alloc_region()->attempt_allocation_locked(min_word_size,
225 desired_word_size,
226 actual_word_size);
227 if (result == NULL) {
|
187 }
188
189 HeapWord* G1Allocator::survivor_attempt_allocation(size_t min_word_size,
190 size_t desired_word_size,
191 size_t* actual_word_size) {
192 assert(!_g1h->is_humongous(desired_word_size),
193 "we should not be seeing humongous-size allocations in this path");
194
195 HeapWord* result = survivor_gc_alloc_region()->attempt_allocation(min_word_size,
196 desired_word_size,
197 actual_word_size);
198 if (result == NULL && !survivor_is_full()) {
199 MutexLocker x(FreeList_lock, Mutex::_no_safepoint_check_flag);
200 result = survivor_gc_alloc_region()->attempt_allocation_locked(min_word_size,
201 desired_word_size,
202 actual_word_size);
203 if (result == NULL) {
204 set_survivor_full();
205 }
206 }
207 if (!G1FastWriteBarrier && result != NULL) {
208 _g1h->dirty_young_block(result, *actual_word_size);
209 }
210 return result;
211 }
212
213 HeapWord* G1Allocator::old_attempt_allocation(size_t min_word_size,
214 size_t desired_word_size,
215 size_t* actual_word_size) {
216 assert(!_g1h->is_humongous(desired_word_size),
217 "we should not be seeing humongous-size allocations in this path");
218
219 HeapWord* result = old_gc_alloc_region()->attempt_allocation(min_word_size,
220 desired_word_size,
221 actual_word_size);
222 if (result == NULL && !old_is_full()) {
223 MutexLocker x(FreeList_lock, Mutex::_no_safepoint_check_flag);
224 result = old_gc_alloc_region()->attempt_allocation_locked(min_word_size,
225 desired_word_size,
226 actual_word_size);
227 if (result == NULL) {
|