331 const size_t len = payload_size * HeapWordSize / sizeof(jint); |
331 const size_t len = payload_size * HeapWordSize / sizeof(jint); |
332 assert((int)len >= 0, err_msg("size too large " SIZE_FORMAT " becomes %d", words, (int)len)); |
332 assert((int)len >= 0, err_msg("size too large " SIZE_FORMAT " becomes %d", words, (int)len)); |
333 |
333 |
334 // Set the length first for concurrent GC. |
334 // Set the length first for concurrent GC. |
335 ((arrayOop)start)->set_length((int)len); |
335 ((arrayOop)start)->set_length((int)len); |
336 post_allocation_setup_common(Universe::intArrayKlassObj(), start, words); |
336 post_allocation_setup_common(Universe::intArrayKlassObj(), start); |
337 DEBUG_ONLY(zap_filler_array(start, words, zap);) |
337 DEBUG_ONLY(zap_filler_array(start, words, zap);) |
338 } |
338 } |
339 |
339 |
340 void |
340 void |
341 CollectedHeap::fill_with_object_impl(HeapWord* start, size_t words, bool zap) |
341 CollectedHeap::fill_with_object_impl(HeapWord* start, size_t words, bool zap) |
344 |
344 |
345 if (words >= filler_array_min_size()) { |
345 if (words >= filler_array_min_size()) { |
346 fill_with_array(start, words, zap); |
346 fill_with_array(start, words, zap); |
347 } else if (words > 0) { |
347 } else if (words > 0) { |
348 assert(words == min_fill_size(), "unaligned size"); |
348 assert(words == min_fill_size(), "unaligned size"); |
349 post_allocation_setup_common(SystemDictionary::Object_klass(), start, |
349 post_allocation_setup_common(SystemDictionary::Object_klass(), start); |
350 words); |
|
351 } |
350 } |
352 } |
351 } |
353 |
352 |
354 void CollectedHeap::fill_with_object(HeapWord* start, size_t words, bool zap) |
353 void CollectedHeap::fill_with_object(HeapWord* start, size_t words, bool zap) |
355 { |
354 { |
475 obj = common_permanent_mem_allocate_init(size, CHECK_NULL); |
474 obj = common_permanent_mem_allocate_init(size, CHECK_NULL); |
476 } else { |
475 } else { |
477 assert(ScavengeRootsInCode > 0, "must be"); |
476 assert(ScavengeRootsInCode > 0, "must be"); |
478 obj = common_mem_allocate_init(size, CHECK_NULL); |
477 obj = common_mem_allocate_init(size, CHECK_NULL); |
479 } |
478 } |
480 post_allocation_setup_common(klass, obj, size); |
479 post_allocation_setup_common(klass, obj); |
481 assert(Universe::is_bootstrapping() || |
480 assert(Universe::is_bootstrapping() || |
482 !((oop)obj)->blueprint()->oop_is_array(), "must not be an array"); |
481 !((oop)obj)->blueprint()->oop_is_array(), "must not be an array"); |
483 NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); |
482 NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); |
484 oop mirror = (oop)obj; |
483 oop mirror = (oop)obj; |
485 |
484 |