--- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp Wed Oct 07 19:01:55 2009 -0400
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp Fri Oct 16 02:05:46 2009 -0700
@@ -260,6 +260,17 @@
return true;
}
+ // We don't need barriers for stores to objects in the
+ // young gen and, a fortiori, for initializing stores to
+ // objects therein. This applies to {DefNew,ParNew}+{Tenured,CMS}
+ // only and may need to be re-examined in case other
+ // kinds of collectors are implemented in the future.
+ virtual bool can_elide_initializing_store_barrier(oop new_obj) {
+ assert(UseParNewGC || UseSerialGC || UseConcMarkSweepGC,
+ "Check can_elide_initializing_store_barrier() for this collector");
+ return is_in_youngest((void*)new_obj);
+ }
+
// Can a compiler elide a store barrier when it writes
// a permanent oop into the heap? Applies when the compiler
// is storing x to the heap, where x->is_perm() is true.