diff src/share/vm/gc_interface/collectedHeap.cpp @ 3892:baf763f388e6

7059037: Use BIS for zeroing on T4 Summary: Use BIS for zeroing new allocated big (2Kb and more) objects and arrays. Reviewed-by: never, twisti, ysr
author kvn
date Fri, 26 Aug 2011 08:52:22 -0700
parents 1d1603768966
children d968f546734e
line wrap: on
line diff
--- a/src/share/vm/gc_interface/collectedHeap.cpp	Thu Aug 25 20:29:30 2011 -0700
+++ b/src/share/vm/gc_interface/collectedHeap.cpp	Fri Aug 26 08:52:22 2011 -0700
@@ -157,8 +157,14 @@
     // ..and clear it.
     Copy::zero_to_words(obj, new_tlab_size);
   } else {
-    // ...and clear just the allocated object.
-    Copy::zero_to_words(obj, size);
+    // ...and zap just allocated object.
+#ifdef ASSERT
+    // Skip mangling the space corresponding to the object header to
+    // ensure that the returned space is not considered parsable by
+    // any concurrent GC thread.
+    size_t hdr_size = oopDesc::header_size();
+    Copy::fill_to_words(obj + hdr_size, new_tlab_size - hdr_size, badHeapWordVal);
+#endif // ASSERT
   }
   thread->tlab().fill(obj, obj + size, new_tlab_size);
   return obj;