Mercurial > hg > graal-jvmci-8
comparison src/share/vm/utilities/taskqueue.hpp @ 1024:2c03ce058f55
6888847: TaskQueue needs release_store() for correctness on RMO machines
Summary: See title.
Reviewed-by: jmasa, ysr, jcoomes, iveresov, tonyp
author | bobv |
---|---|
date | Wed, 07 Oct 2009 09:48:42 -0400 |
parents | 3ee342e25e57 |
children | 1ee412f7fec9 |
comparison
equal
deleted
inserted
replaced
1023:11d4857fe5e1 | 1024:2c03ce058f55 |
---|---|
205 bool GenericTaskQueue<E>::push_slow(E t, uint dirty_n_elems) { | 205 bool GenericTaskQueue<E>::push_slow(E t, uint dirty_n_elems) { |
206 if (dirty_n_elems == N - 1) { | 206 if (dirty_n_elems == N - 1) { |
207 // Actually means 0, so do the push. | 207 // Actually means 0, so do the push. |
208 uint localBot = _bottom; | 208 uint localBot = _bottom; |
209 _elems[localBot] = t; | 209 _elems[localBot] = t; |
210 _bottom = increment_index(localBot); | 210 OrderAccess::release_store(&_bottom, increment_index(localBot)); |
211 return true; | 211 return true; |
212 } | 212 } |
213 return false; | 213 return false; |
214 } | 214 } |
215 | 215 |
483 idx_t top = _age.top(); | 483 idx_t top = _age.top(); |
484 uint dirty_n_elems = dirty_size(localBot, top); | 484 uint dirty_n_elems = dirty_size(localBot, top); |
485 assert((dirty_n_elems >= 0) && (dirty_n_elems < N), "n_elems out of range."); | 485 assert((dirty_n_elems >= 0) && (dirty_n_elems < N), "n_elems out of range."); |
486 if (dirty_n_elems < max_elems()) { | 486 if (dirty_n_elems < max_elems()) { |
487 _elems[localBot] = t; | 487 _elems[localBot] = t; |
488 _bottom = increment_index(localBot); | 488 OrderAccess::release_store(&_bottom, increment_index(localBot)); |
489 return true; | 489 return true; |
490 } else { | 490 } else { |
491 return push_slow(t, dirty_n_elems); | 491 return push_slow(t, dirty_n_elems); |
492 } | 492 } |
493 #endif | 493 #endif |