6888898: CMS: ReduceInitialCardMarks unsafe in the presence of cms precleaning

6889757: G1: enable card mark elision for initializing writes from compiled code (ReduceInitialCardMarks)

Defer the (compiler-elided) card-mark upon a slow-path allocation until after the store  and before the next subsequent safepoint; G1 now answers yes to can_elide_tlab_write_barriers().

Reviewed-by: jcoomes, kvn, never
This commit is contained in:
Y. Srinivas Ramakrishna 2009-10-16 02:05:46 -07:00
parent a67426faf8
commit 928ac69fcd
13 changed files with 209 additions and 73 deletions

View file

@ -260,6 +260,17 @@ public:
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.