diff src/share/vm/memory/threadLocalAllocBuffer.inline.hpp @ 1165:2dd52dea6d28

6902115: G1:assert(ignore_max_completed||thread->is_Java_thread()||SafepointSynchronize::is_at_safepoint()) Summary: Remove invalid assert and mangle filler objects in TLABs that are being retired. Reviewed-by: ysr, jmasa
author johnc
date Tue, 12 Jan 2010 14:56:46 -0800
parents a61af66fc99e
children c18cbe5936b8 2d127394260e
line wrap: on
line diff
--- a/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp	Sat Jan 09 09:01:41 2010 -0800
+++ b/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp	Tue Jan 12 14:56:46 2010 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,13 @@
   HeapWord* obj = top();
   if (pointer_delta(end(), obj) >= size) {
     // successful thread-local allocation
-
-    DEBUG_ONLY(Copy::fill_to_words(obj, size, badHeapWordVal));
+#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 = CollectedHeap::min_fill_size();
+    Copy::fill_to_words(obj + hdr_size, size - hdr_size, badHeapWordVal);
+#endif // ASSERT
     // This addition is safe because we know that top is
     // at least size below end, so the add can't wrap.
     set_top(obj + size);