Tue, 20 May 2014 10:24:30 +0200
8039042: G1: Phantom zeros in cardtable
Reviewed-by: tschatzl, mgerdin
src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp Wed May 14 14:32:23 2014 +0200 1.2 +++ b/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp Tue May 20 10:24:30 2014 +0200 1.3 @@ -95,7 +95,15 @@ 1.4 jbyte *const first = byte_for(mr.start()); 1.5 jbyte *const last = byte_after(mr.last()); 1.6 1.7 - memset(first, g1_young_gen, last - first); 1.8 + // Below we may use an explicit loop instead of memset() because on 1.9 + // certain platforms memset() can give concurrent readers phantom zeros. 1.10 + if (UseMemSetInBOT) { 1.11 + memset(first, g1_young_gen, last - first); 1.12 + } else { 1.13 + for (jbyte* i = first; i < last; i++) { 1.14 + *i = g1_young_gen; 1.15 + } 1.16 + } 1.17 } 1.18 1.19 #ifndef PRODUCT