comparison src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp @ 12835:69944b868a32

8014555: G1: Memory ordering problem with Conc refinement and card marking Summary: Add a StoreLoad barrier in the G1 post-barrier to fix a race with concurrent refinement. Also-reviewed-by: martin.doerr@sap.com Reviewed-by: iveresov, tschatzl, brutisso, roland, kvn
author mgerdin
date Tue, 08 Oct 2013 17:35:51 +0200
parents d55c004e1d4d
children de6a9e811145 3205e78d8193
comparison
equal deleted inserted replaced
12834:04b18a42c2f3 12835:69944b868a32
36 36
37 // This barrier is specialized to use a logging barrier to support 37 // This barrier is specialized to use a logging barrier to support
38 // snapshot-at-the-beginning marking. 38 // snapshot-at-the-beginning marking.
39 39
40 class G1SATBCardTableModRefBS: public CardTableModRefBSForCTRS { 40 class G1SATBCardTableModRefBS: public CardTableModRefBSForCTRS {
41 protected:
42 enum G1CardValues {
43 g1_young_gen = CT_MR_BS_last_reserved << 1
44 };
45
41 public: 46 public:
47 static int g1_young_card_val() { return g1_young_gen; }
48
42 // Add "pre_val" to a set of objects that may have been disconnected from the 49 // Add "pre_val" to a set of objects that may have been disconnected from the
43 // pre-marking object graph. 50 // pre-marking object graph.
44 static void enqueue(oop pre_val); 51 static void enqueue(oop pre_val);
45 52
46 G1SATBCardTableModRefBS(MemRegion whole_heap, 53 G1SATBCardTableModRefBS(MemRegion whole_heap,
116 val |= (jbyte)claimed_card_val(); 123 val |= (jbyte)claimed_card_val();
117 } 124 }
118 _byte_map[card_index] = val; 125 _byte_map[card_index] = val;
119 } 126 }
120 127
128 void verify_g1_young_region(MemRegion mr) PRODUCT_RETURN;
129 void g1_mark_as_young(const MemRegion& mr);
130
121 bool mark_card_deferred(size_t card_index); 131 bool mark_card_deferred(size_t card_index);
122 132
123 bool is_card_deferred(size_t card_index) { 133 bool is_card_deferred(size_t card_index) {
124 jbyte val = _byte_map[card_index]; 134 jbyte val = _byte_map[card_index];
125 return (val & (clean_card_mask_val() | deferred_card_val())) == deferred_card_val(); 135 return (val & (clean_card_mask_val() | deferred_card_val())) == deferred_card_val();