250 // prev-younger-gen ==> cur_youngergen_and_prev_nonclean_card |
250 // prev-younger-gen ==> cur_youngergen_and_prev_nonclean_card |
251 // cur-younger-gen ==> cur_younger_gen |
251 // cur-younger-gen ==> cur_younger_gen |
252 // cur_youngergen_and_prev_nonclean_card ==> no change. |
252 // cur_youngergen_and_prev_nonclean_card ==> no change. |
253 void CardTableRS::write_ref_field_gc_par(void* field, oop new_val) { |
253 void CardTableRS::write_ref_field_gc_par(void* field, oop new_val) { |
254 jbyte* entry = ct_bs()->byte_for(field); |
254 jbyte* entry = ct_bs()->byte_for(field); |
255 #ifdef MIPS |
255 #if defined MIPS && !defined ZERO |
256 if (UseSyncLevel >= 2000) OrderAccess::fence(); |
256 if (UseSyncLevel >= 2000) OrderAccess::fence(); |
257 #endif |
257 #endif |
258 do { |
258 do { |
259 jbyte entry_val = *entry; |
259 jbyte entry_val = *entry; |
260 // We put this first because it's probably the most common case. |
260 // We put this first because it's probably the most common case. |
268 // eventually remove the previous stuff. |
268 // eventually remove the previous stuff. |
269 jbyte new_val = cur_youngergen_and_prev_nonclean_card; |
269 jbyte new_val = cur_youngergen_and_prev_nonclean_card; |
270 jbyte res = Atomic::cmpxchg(new_val, entry, entry_val); |
270 jbyte res = Atomic::cmpxchg(new_val, entry, entry_val); |
271 // Did the CAS succeed? |
271 // Did the CAS succeed? |
272 if (res == entry_val) { |
272 if (res == entry_val) { |
273 #ifdef MIPS |
273 #if defined MIPS && !defined ZERO |
274 if (UseSyncLevel >= 2000) OrderAccess::fence(); |
274 if (UseSyncLevel >= 2000) OrderAccess::fence(); |
275 #endif |
275 #endif |
276 return; |
276 return; |
277 } |
277 } |
278 // Otherwise, retry, to see the new value. |
278 // Otherwise, retry, to see the new value. |
279 continue; |
279 continue; |
280 } else { |
280 } else { |