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) {
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 }
598
599 size_t CollectedHeap::obj_size(oop obj) const {
600 return obj->size();
601 }
|
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) {
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 }
|