mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 03:24:38 +02:00
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:
parent
95c56a472b
commit
47e357e16f
13 changed files with 97 additions and 11 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue