comparison src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp @ 5188:5afc5a089c2c

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. Reviewed-by: brutisso, tschatzl, roland
author mgerdin
date Tue, 08 Oct 2013 17:35:51 +0200
parents eacc90e71427
children 5d0a13adec23
comparison
equal deleted inserted replaced
8:45f18118b9ae 9:21ab8fb47d0f
35 35
36 // This barrier is specialized to use a logging barrier to support 36 // This barrier is specialized to use a logging barrier to support
37 // snapshot-at-the-beginning marking. 37 // snapshot-at-the-beginning marking.
38 38
39 class G1SATBCardTableModRefBS: public CardTableModRefBSForCTRS { 39 class G1SATBCardTableModRefBS: public CardTableModRefBSForCTRS {
40 protected:
41 enum G1CardValues {
42 g1_young_gen = CT_MR_BS_last_reserved << 1
43 };
44
40 public: 45 public:
46 static int g1_young_card_val() { return g1_young_gen; }
47
41 // Add "pre_val" to a set of objects that may have been disconnected from the 48 // Add "pre_val" to a set of objects that may have been disconnected from the
42 // pre-marking object graph. 49 // pre-marking object graph.
43 static void enqueue(oop pre_val); 50 static void enqueue(oop pre_val);
44 51
45 G1SATBCardTableModRefBS(MemRegion whole_heap, 52 G1SATBCardTableModRefBS(MemRegion whole_heap,
115 val |= (jbyte)claimed_card_val(); 122 val |= (jbyte)claimed_card_val();
116 } 123 }
117 _byte_map[card_index] = val; 124 _byte_map[card_index] = val;
118 } 125 }
119 126
127 void verify_g1_young_region(MemRegion mr) PRODUCT_RETURN;
128 void g1_mark_as_young(const MemRegion& mr);
129
120 bool mark_card_deferred(size_t card_index); 130 bool mark_card_deferred(size_t card_index);
121 131
122 bool is_card_deferred(size_t card_index) { 132 bool is_card_deferred(size_t card_index) {
123 jbyte val = _byte_map[card_index]; 133 jbyte val = _byte_map[card_index];
124 return (val & (clean_card_mask_val() | deferred_card_val())) == deferred_card_val(); 134 return (val & (clean_card_mask_val() | deferred_card_val())) == deferred_card_val();