< prev index next >

src/hotspot/share/gc/g1/g1CollectedHeap.cpp

Print this page
rev 49945 : imported patch 8191471-g1-varying-tlab-allocation
rev 49949 : imported patch 8191471-tschatzl-comments-open
rev 49950 : [mq]: 8191471-pliden-comments


 367       // Policy: Potentially trigger a defragmentation GC.
 368     }
 369   }
 370 
 371   HeapWord* result = NULL;
 372   if (first != G1_NO_HRM_INDEX) {
 373     result = humongous_obj_allocate_initialize_regions(first, obj_regions, word_size);
 374     assert(result != NULL, "it should always return a valid result");
 375 
 376     // A successful humongous object allocation changes the used space
 377     // information of the old generation so we need to recalculate the
 378     // sizes and update the jstat counters here.
 379     g1mm()->update_sizes();
 380   }
 381 
 382   _verifier->verify_region_sets_optional();
 383 
 384   return result;
 385 }
 386 
 387 HeapWord* G1CollectedHeap::allocate_new_tlab(size_t min_word_size,
 388                                              size_t desired_word_size,
 389                                              size_t* actual_word_size) {
 390   assert_heap_not_locked_and_not_at_safepoint();
 391   assert(!is_humongous(desired_word_size), "we do not allow humongous TLABs");
 392 
 393   return attempt_allocation(min_word_size, desired_word_size, actual_word_size);
 394 }
 395 
 396 HeapWord*
 397 G1CollectedHeap::mem_allocate(size_t word_size,
 398                               bool*  gc_overhead_limit_was_exceeded) {
 399   assert_heap_not_locked_and_not_at_safepoint();
 400 
 401   if (is_humongous(word_size)) {
 402     return attempt_allocation_humongous(word_size);
 403   }
 404   size_t dummy = 0;
 405   return attempt_allocation(word_size, word_size, &dummy);
 406 }
 407 
 408 HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size) {
 409   ResourceMark rm; // For retrieving the thread names in log messages.
 410 
 411   // Make sure you read the note in attempt_allocation_humongous().
 412 
 413   assert_heap_not_locked_and_not_at_safepoint();




 367       // Policy: Potentially trigger a defragmentation GC.
 368     }
 369   }
 370 
 371   HeapWord* result = NULL;
 372   if (first != G1_NO_HRM_INDEX) {
 373     result = humongous_obj_allocate_initialize_regions(first, obj_regions, word_size);
 374     assert(result != NULL, "it should always return a valid result");
 375 
 376     // A successful humongous object allocation changes the used space
 377     // information of the old generation so we need to recalculate the
 378     // sizes and update the jstat counters here.
 379     g1mm()->update_sizes();
 380   }
 381 
 382   _verifier->verify_region_sets_optional();
 383 
 384   return result;
 385 }
 386 
 387 HeapWord* G1CollectedHeap::allocate_new_tlab(size_t min_size,
 388                                              size_t requested_size,
 389                                              size_t* actual_size) {
 390   assert_heap_not_locked_and_not_at_safepoint();
 391   assert(!is_humongous(requested_size), "we do not allow humongous TLABs");
 392 
 393   return attempt_allocation(min_size, requested_size, actual_size);
 394 }
 395 
 396 HeapWord*
 397 G1CollectedHeap::mem_allocate(size_t word_size,
 398                               bool*  gc_overhead_limit_was_exceeded) {
 399   assert_heap_not_locked_and_not_at_safepoint();
 400 
 401   if (is_humongous(word_size)) {
 402     return attempt_allocation_humongous(word_size);
 403   }
 404   size_t dummy = 0;
 405   return attempt_allocation(word_size, word_size, &dummy);
 406 }
 407 
 408 HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size) {
 409   ResourceMark rm; // For retrieving the thread names in log messages.
 410 
 411   // Make sure you read the note in attempt_allocation_humongous().
 412 
 413   assert_heap_not_locked_and_not_at_safepoint();


< prev index next >