Atomic::replace_if_null was added (by JDK-8186166) to simplify a common use-case for Atomic::cmpxchg, where the old value to be replaced is NULL (which needs to be cast to the proper type), and the caller needs a success/failure result for the cmpxchg.
When Atomic::cmpxchg_ptr calls were converted to make use of the new templatized implementation (JDK-8188220), all such calls were converted to Atomic::cmpxchg, even where Atomic::replace_if_null could have been used. Those places which could use Atomic::replace_if_null should be converted to do so. (Or else we should just eliminate replace_if_null).
When Atomic::cmpxchg_ptr calls were converted to make use of the new templatized implementation (
- relates to
-
JDK-8186166 Generalize Atomic::cmpxchg with templates
- Resolved
-
JDK-8188220 Remove Atomic::*_ptr() uses and overloads from hotspot
- Resolved