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();
568 reset_promotion_should_fail(&_promotion_failure_alot_count);
569 }
570
571 #endif // #ifndef PRODUCT
572
573 bool CollectedHeap::supports_object_pinning() const {
574 return false;
575 }
576
577 oop CollectedHeap::pin_object(JavaThread* thread, oop obj) {
578 ShouldNotReachHere();
579 return NULL;
580 }
581
582 void CollectedHeap::unpin_object(JavaThread* thread, oop obj) {
583 ShouldNotReachHere();
584 }
585
586 void CollectedHeap::deduplicate_string(oop str) {
587 // Do nothing, unless overridden in subclass.
588 }
589
590 size_t CollectedHeap::obj_size(oop obj) const {
591 return obj->size();
592 }
|
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 cell_size(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();
577 reset_promotion_should_fail(&_promotion_failure_alot_count);
578 }
579
580 #endif // #ifndef PRODUCT
581
582 bool CollectedHeap::supports_object_pinning() const {
583 return false;
584 }
585
586 oop CollectedHeap::pin_object(JavaThread* thread, oop obj) {
587 ShouldNotReachHere();
588 return NULL;
589 }
590
591 void CollectedHeap::unpin_object(JavaThread* thread, oop obj) {
592 ShouldNotReachHere();
593 }
594
595 void CollectedHeap::deduplicate_string(oop str) {
596 // Do nothing, unless overridden in subclass.
597 }
|