comparison src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp @ 12343:d55c004e1d4d

8025305: Cleanup CardTableModRefBS usage in G1 Summary: Move some G1 specific code from CardTableModRefBS to G1SATBCardTableModRefBS. Reviewed-by: brutisso, tschatzl, ehelin
author mgerdin
date Tue, 24 Sep 2013 14:46:29 +0200
parents db9981fd3124
children 69944b868a32
comparison
equal deleted inserted replaced
12342:ccef6e165e8b 12343:d55c004e1d4d
87 virtual void write_ref_array_pre(narrowOop* dst, int count, bool dest_uninitialized) { 87 virtual void write_ref_array_pre(narrowOop* dst, int count, bool dest_uninitialized) {
88 if (!dest_uninitialized) { 88 if (!dest_uninitialized) {
89 write_ref_array_pre_work(dst, count); 89 write_ref_array_pre_work(dst, count);
90 } 90 }
91 } 91 }
92
93 /*
94 Claimed and deferred bits are used together in G1 during the evacuation
95 pause. These bits can have the following state transitions:
96 1. The claimed bit can be put over any other card state. Except that
97 the "dirty -> dirty and claimed" transition is checked for in
98 G1 code and is not used.
99 2. Deferred bit can be set only if the previous state of the card
100 was either clean or claimed. mark_card_deferred() is wait-free.
101 We do not care if the operation is be successful because if
102 it does not it will only result in duplicate entry in the update
103 buffer because of the "cache-miss". So it's not worth spinning.
104 */
105
106 bool is_card_claimed(size_t card_index) {
107 jbyte val = _byte_map[card_index];
108 return (val & (clean_card_mask_val() | claimed_card_val())) == claimed_card_val();
109 }
110
111 void set_card_claimed(size_t card_index) {
112 jbyte val = _byte_map[card_index];
113 if (val == clean_card_val()) {
114 val = (jbyte)claimed_card_val();
115 } else {
116 val |= (jbyte)claimed_card_val();
117 }
118 _byte_map[card_index] = val;
119 }
120
121 bool mark_card_deferred(size_t card_index);
122
123 bool is_card_deferred(size_t card_index) {
124 jbyte val = _byte_map[card_index];
125 return (val & (clean_card_mask_val() | deferred_card_val())) == deferred_card_val();
126 }
127
92 }; 128 };
93 129
94 // Adds card-table logging to the post-barrier. 130 // Adds card-table logging to the post-barrier.
95 // Usual invariant: all dirty cards are logged in the DirtyCardQueueSet. 131 // Usual invariant: all dirty cards are logged in the DirtyCardQueueSet.
96 class G1SATBCardTableLoggingModRefBS: public G1SATBCardTableModRefBS { 132 class G1SATBCardTableLoggingModRefBS: public G1SATBCardTableModRefBS {