255 // because of AlignmentReserve (see PLAB::allocate()).
256 assert(obj != NULL || plab->words_remaining() < word_sz,
257 "Else should have been able to allocate");
258 // It's conceivable that we may be able to use the
259 // buffer we just grabbed for subsequent small requests
260 // even if not for this one.
261 } else {
262 // We're used up.
263 _to_space_full = true;
264 }
265
266 } else {
267 // Too large; allocate the object individually.
268 obj = sp->par_allocate(word_sz);
269 }
270 }
271 return obj;
272 }
273
274
275 void ParScanThreadState::undo_alloc_in_to_space(HeapWord* obj,
276 size_t word_sz) {
277 // Is the alloc in the current alloc buffer?
278 if (to_space_alloc_buffer()->contains(obj)) {
279 assert(to_space_alloc_buffer()->contains(obj + word_sz - 1),
280 "Should contain whole object.");
281 to_space_alloc_buffer()->undo_allocation(obj, word_sz);
282 } else {
283 CollectedHeap::fill_with_object(obj, word_sz);
284 }
285 }
286
287 void ParScanThreadState::print_promotion_failure_size() {
288 if (_promotion_failed_info.has_failed() && PrintPromotionFailure) {
289 gclog_or_tty->print(" (%d: promotion failure size = " SIZE_FORMAT ") ",
290 _thread_num, _promotion_failed_info.first_size());
291 }
292 }
293
294 class ParScanThreadStateSet: private ResourceArray {
295 public:
296 // Initializes states for the specified number of threads;
297 ParScanThreadStateSet(int num_threads,
298 Space& to_space,
299 ParNewGeneration& gen,
300 Generation& old_gen,
301 ObjToScanQueueSet& queue_set,
302 Stack<oop, mtGC>* overflow_stacks_,
303 size_t desired_plab_sz,
304 ParallelTaskTerminator& term);
|
255 // because of AlignmentReserve (see PLAB::allocate()).
256 assert(obj != NULL || plab->words_remaining() < word_sz,
257 "Else should have been able to allocate");
258 // It's conceivable that we may be able to use the
259 // buffer we just grabbed for subsequent small requests
260 // even if not for this one.
261 } else {
262 // We're used up.
263 _to_space_full = true;
264 }
265
266 } else {
267 // Too large; allocate the object individually.
268 obj = sp->par_allocate(word_sz);
269 }
270 }
271 return obj;
272 }
273
274
275 void ParScanThreadState::undo_alloc_in_to_space(HeapWord* obj, size_t word_sz) {
276 to_space_alloc_buffer()->undo_allocation(obj, word_sz);
277 }
278
279 void ParScanThreadState::print_promotion_failure_size() {
280 if (_promotion_failed_info.has_failed() && PrintPromotionFailure) {
281 gclog_or_tty->print(" (%d: promotion failure size = " SIZE_FORMAT ") ",
282 _thread_num, _promotion_failed_info.first_size());
283 }
284 }
285
286 class ParScanThreadStateSet: private ResourceArray {
287 public:
288 // Initializes states for the specified number of threads;
289 ParScanThreadStateSet(int num_threads,
290 Space& to_space,
291 ParNewGeneration& gen,
292 Generation& old_gen,
293 ObjToScanQueueSet& queue_set,
294 Stack<oop, mtGC>* overflow_stacks_,
295 size_t desired_plab_sz,
296 ParallelTaskTerminator& term);
|