diff src/share/vm/gc_interface/collectedHeap.inline.hpp @ 3961:a92cdbac8b9e

7081933: Use zeroing elimination optimization for large array Summary: Don't zero new typeArray during runtime call if the allocation is followed by arraycopy into it. Reviewed-by: twisti
author kvn
date Mon, 26 Sep 2011 10:24:05 -0700
parents f08d439fab8c
children 9a9bb0010c91
line wrap: on
line diff
--- a/src/share/vm/gc_interface/collectedHeap.inline.hpp	Sun Sep 25 16:03:29 2011 -0700
+++ b/src/share/vm/gc_interface/collectedHeap.inline.hpp	Mon Sep 26 10:24:05 2011 -0700
@@ -274,6 +274,23 @@
   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);