< prev index next >

src/hotspot/share/gc/shared/collectedHeap.cpp

Print this page
rev 52072 : 8211955: GC abstraction for LAB reserve


 428 
 429   // Multiple objects may be required depending on the filler array maximum size. Fill
 430   // the range up to that with objects that are filler_array_max_size sized. The
 431   // remainder is filled with a single object.
 432   const size_t min = min_fill_size();
 433   const size_t max = filler_array_max_size();
 434   while (words > max) {
 435     const size_t cur = (words - max) >= min ? max : max - min;
 436     fill_with_array(start, cur, zap);
 437     start += cur;
 438     words -= cur;
 439   }
 440 
 441   fill_with_object_impl(start, words, zap);
 442 }
 443 
 444 void CollectedHeap::fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap) {
 445   CollectedHeap::fill_with_object(start, end, zap);
 446 }
 447 









 448 HeapWord* CollectedHeap::allocate_new_tlab(size_t min_size,
 449                                            size_t requested_size,
 450                                            size_t* actual_size) {
 451   guarantee(false, "thread-local allocation buffers not supported");
 452   return NULL;
 453 }
 454 
 455 oop CollectedHeap::obj_allocate(Klass* klass, int size, TRAPS) {
 456   ObjAllocator allocator(klass, size, THREAD);
 457   return allocator.allocate();
 458 }
 459 
 460 oop CollectedHeap::array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS) {
 461   ObjArrayAllocator allocator(klass, size, length, do_zero, THREAD);
 462   return allocator.allocate();
 463 }
 464 
 465 oop CollectedHeap::class_allocate(Klass* klass, int size, TRAPS) {
 466   ClassAllocator allocator(klass, size, THREAD);
 467   return allocator.allocate();




 428 
 429   // Multiple objects may be required depending on the filler array maximum size. Fill
 430   // the range up to that with objects that are filler_array_max_size sized. The
 431   // remainder is filled with a single object.
 432   const size_t min = min_fill_size();
 433   const size_t max = filler_array_max_size();
 434   while (words > max) {
 435     const size_t cur = (words - max) >= min ? max : max - min;
 436     fill_with_array(start, cur, zap);
 437     start += cur;
 438     words -= cur;
 439   }
 440 
 441   fill_with_object_impl(start, words, zap);
 442 }
 443 
 444 void CollectedHeap::fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap) {
 445   CollectedHeap::fill_with_object(start, end, zap);
 446 }
 447 
 448 size_t CollectedHeap::min_dummy_object_size() const {
 449   return oopDesc::header_size();
 450 }
 451 
 452 size_t CollectedHeap::tlab_alloc_reserve() const {
 453   size_t min_size = min_dummy_object_size();
 454   return min_size > (size_t)MinObjAlignment ? align_object_size(min_size) : 0;
 455 }
 456 
 457 HeapWord* CollectedHeap::allocate_new_tlab(size_t min_size,
 458                                            size_t requested_size,
 459                                            size_t* actual_size) {
 460   guarantee(false, "thread-local allocation buffers not supported");
 461   return NULL;
 462 }
 463 
 464 oop CollectedHeap::obj_allocate(Klass* klass, int size, TRAPS) {
 465   ObjAllocator allocator(klass, size, THREAD);
 466   return allocator.allocate();
 467 }
 468 
 469 oop CollectedHeap::array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS) {
 470   ObjArrayAllocator allocator(klass, size, length, do_zero, THREAD);
 471   return allocator.allocate();
 472 }
 473 
 474 oop CollectedHeap::class_allocate(Klass* klass, int size, TRAPS) {
 475   ClassAllocator allocator(klass, size, THREAD);
 476   return allocator.allocate();


< prev index next >