89 if (!dest_uninitialized) { |
89 if (!dest_uninitialized) { |
90 write_ref_array_pre_work(dst, count); |
90 write_ref_array_pre_work(dst, count); |
91 } |
91 } |
92 } |
92 } |
93 |
93 |
94 void G1BarrierSet::write_ref_field_post_slow(volatile jbyte* byte) { |
94 void G1BarrierSet::write_ref_field_post_slow(volatile CardValue* byte) { |
95 // In the slow path, we know a card is not young |
95 // In the slow path, we know a card is not young |
96 assert(*byte != G1CardTable::g1_young_card_val(), "slow path invoked without filtering"); |
96 assert(*byte != G1CardTable::g1_young_card_val(), "slow path invoked without filtering"); |
97 OrderAccess::storeload(); |
97 OrderAccess::storeload(); |
98 if (*byte != G1CardTable::dirty_card_val()) { |
98 if (*byte != G1CardTable::dirty_card_val()) { |
99 *byte = G1CardTable::dirty_card_val(); |
99 *byte = G1CardTable::dirty_card_val(); |
104 |
104 |
105 void G1BarrierSet::invalidate(MemRegion mr) { |
105 void G1BarrierSet::invalidate(MemRegion mr) { |
106 if (mr.is_empty()) { |
106 if (mr.is_empty()) { |
107 return; |
107 return; |
108 } |
108 } |
109 volatile jbyte* byte = _card_table->byte_for(mr.start()); |
109 volatile CardValue* byte = _card_table->byte_for(mr.start()); |
110 jbyte* last_byte = _card_table->byte_for(mr.last()); |
110 CardValue* last_byte = _card_table->byte_for(mr.last()); |
111 // skip initial young cards |
111 // skip initial young cards |
112 for (; byte <= last_byte && *byte == G1CardTable::g1_young_card_val(); byte++); |
112 for (; byte <= last_byte && *byte == G1CardTable::g1_young_card_val(); byte++); |
113 |
113 |
114 if (byte <= last_byte) { |
114 if (byte <= last_byte) { |
115 OrderAccess::storeload(); |
115 OrderAccess::storeload(); |
116 // Enqueue if necessary. |
116 // Enqueue if necessary. |
117 Thread* thr = Thread::current(); |
117 Thread* thr = Thread::current(); |
118 G1DirtyCardQueue& queue = G1ThreadLocalData::dirty_card_queue(thr); |
118 G1DirtyCardQueue& queue = G1ThreadLocalData::dirty_card_queue(thr); |
119 for (; byte <= last_byte; byte++) { |
119 for (; byte <= last_byte; byte++) { |
120 jbyte bv = *byte; |
120 CardValue bv = *byte; |
121 if ((bv != G1CardTable::g1_young_card_val()) && |
121 if ((bv != G1CardTable::g1_young_card_val()) && |
122 (bv != G1CardTable::dirty_card_val())) { |
122 (bv != G1CardTable::dirty_card_val())) { |
123 *byte = G1CardTable::dirty_card_val(); |
123 *byte = G1CardTable::dirty_card_val(); |
124 queue.enqueue(byte); |
124 queue.enqueue(byte); |
125 } |
125 } |