7081933: Use zeroing elimination optimization for large array

Don't zero new typeArray during runtime call if the allocation is followed by arraycopy into it.

Reviewed-by: twisti
This commit is contained in:
Vladimir Kozlov 2011-09-26 10:24:05 -07:00
parent 95c56a472b
commit 47e357e16f
13 changed files with 97 additions and 11 deletions

View file

@ -274,6 +274,23 @@ oop CollectedHeap::array_allocate(KlassHandle klass,
return (oop)obj;
}
oop CollectedHeap::array_allocate_nozero(KlassHandle klass,
int size,
int length,
TRAPS) {
debug_only(check_for_valid_allocation_state());
assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed");
assert(size >= 0, "int won't convert to size_t");
HeapWord* obj = common_mem_allocate_noinit(size, CHECK_NULL);
((oop)obj)->set_klass_gap(0);
post_allocation_setup_array(klass, obj, size, length);
#ifndef PRODUCT
const size_t hs = oopDesc::header_size()+1;
Universe::heap()->check_for_non_bad_heap_word_value(obj+hs, size-hs);
#endif
return (oop)obj;
}
oop CollectedHeap::permanent_obj_allocate(KlassHandle klass, int size, TRAPS) {
oop obj = permanent_obj_allocate_no_klass_install(klass, size, CHECK_NULL);
post_allocation_install_obj_klass(klass, obj, size);