6896647: card marks can be deferred too long

Deferred card marks are now flushed during the gc prologue. Parallel[Scavege,OldGC] and SerialGC no longer defer card marks generated by COMPILER2 as a result of ReduceInitialCardMarks. For these cases, introduced a diagnostic option to defer the card marks, only for the purposes of testing and diagnostics. CMS and G1 continue to defer card marks. Potential performance concern related to single-threaded flushing of deferred card marks in the gc prologue will be addressed in the future.

Reviewed-by: never, johnc
This commit is contained in:
Y. Srinivas Ramakrishna 2010-01-13 15:26:39 -08:00
parent 0917ad432e
commit 331512606a
14 changed files with 107 additions and 54 deletions

View file

@ -3259,9 +3259,10 @@ void GraphKit::write_barrier_post(Node* oop_store,
if (use_ReduceInitialCardMarks()
&& obj == just_allocated_object(control())) {
// We can skip marks on a freshly-allocated object in Eden.
// Keep this code in sync with maybe_defer_card_mark() in runtime.cpp.
// That routine informs GC to take appropriate compensating steps
// so as to make this card-mark elision safe.
// Keep this code in sync with new_store_pre_barrier() in runtime.cpp.
// That routine informs GC to take appropriate compensating steps,
// upon a slow-path allocation, so as to make this card-mark
// elision safe.
return;
}