comparison src/share/vm/utilities/bitMap.cpp @ 17662:695a6aba51c3

8033545: Missing volatile specifier in Bitmap::par_put_range_within_word Summary: The method Bitmap::par_put_range_within_word reloads the original value during a CAS, which may be optimized away. Instead of reloading, use the value returned by Atomic::cmpxchg_ptr() for further processing. Reviewed-by: tschatzl, brutisso, tonyp Contributed-by: Matthias Braun <matthia.braun@sap.com>
author tschatzl
date Mon, 10 Feb 2014 10:34:52 +0100
parents 55fb97c4c58d
children 8a9bb7821e28
comparison
equal deleted inserted replaced
17661:a2e452cdf1d5 17662:695a6aba51c3
105 intptr_t mr = (intptr_t)inverted_bit_mask_for_range(beg, end); 105 intptr_t mr = (intptr_t)inverted_bit_mask_for_range(beg, end);
106 intptr_t nw = value ? (w | ~mr) : (w & mr); 106 intptr_t nw = value ? (w | ~mr) : (w & mr);
107 while (true) { 107 while (true) {
108 intptr_t res = Atomic::cmpxchg_ptr(nw, pw, w); 108 intptr_t res = Atomic::cmpxchg_ptr(nw, pw, w);
109 if (res == w) break; 109 if (res == w) break;
110 w = *pw; 110 w = res;
111 nw = value ? (w | ~mr) : (w & mr); 111 nw = value ? (w | ~mr) : (w & mr);
112 } 112 }
113 } 113 }
114 } 114 }
115 115