comparison src/share/vm/memory/genCollectedHeap.hpp @ 1027:39b01ab7035a

6888898: CMS: ReduceInitialCardMarks unsafe in the presence of cms precleaning 6889757: G1: enable card mark elision for initializing writes from compiled code (ReduceInitialCardMarks) Summary: 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
author ysr
date Fri, 16 Oct 2009 02:05:46 -0700
parents 148e5441d916
children 052a899eec3e
comparison
equal deleted inserted replaced
1025:1ee412f7fec9 1027:39b01ab7035a
256 // Can a compiler initialize a new object without store barriers? 256 // Can a compiler initialize a new object without store barriers?
257 // This permission only extends from the creation of a new object 257 // This permission only extends from the creation of a new object
258 // via a TLAB up to the first subsequent safepoint. 258 // via a TLAB up to the first subsequent safepoint.
259 virtual bool can_elide_tlab_store_barriers() const { 259 virtual bool can_elide_tlab_store_barriers() const {
260 return true; 260 return true;
261 }
262
263 // We don't need barriers for stores to objects in the
264 // young gen and, a fortiori, for initializing stores to
265 // objects therein. This applies to {DefNew,ParNew}+{Tenured,CMS}
266 // only and may need to be re-examined in case other
267 // kinds of collectors are implemented in the future.
268 virtual bool can_elide_initializing_store_barrier(oop new_obj) {
269 assert(UseParNewGC || UseSerialGC || UseConcMarkSweepGC,
270 "Check can_elide_initializing_store_barrier() for this collector");
271 return is_in_youngest((void*)new_obj);
261 } 272 }
262 273
263 // Can a compiler elide a store barrier when it writes 274 // Can a compiler elide a store barrier when it writes
264 // a permanent oop into the heap? Applies when the compiler 275 // a permanent oop into the heap? Applies when the compiler
265 // is storing x to the heap, where x->is_perm() is true. 276 // is storing x to the heap, where x->is_perm() is true.