RFR: 8186166: Generalize Atomic::cmpxchg with templates

Kim Barrett kim.barrett at oracle.com
Thu Aug 17 17:42:18 UTC 2017

> On Aug 17, 2017, at 1:30 PM, coleen.phillimore at oracle.com wrote:
> On 8/16/17 2:03 AM, Kim Barrett wrote:
>> New webrevs:
>> full: http://cr.openjdk.java.net/~kbarrett/8186166/hotspot.01/
>> incr: http://cr.openjdk.java.net/~kbarrett/8186166/hotspot.01.inc/
> I like the name change to cmpxchg_using_helper.
> http://cr.openjdk.java.net/~kbarrett/8186166/hotspot.01.inc/src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.hpp.udiff.html
> Why does this have <byte_size> rather than the constants like the other platforms?

One definition for all cases.  The other platforms have different (sometimes only very slightly) code in the specializations for the different sizes.  In this case, it’s the same code, regardless of the size.  So we don’t need multiple specializations, one for each specific size.

> http://cr.openjdk.java.net/~kbarrett/8186166/hotspot.01.inc/src/share/vm/metaprogramming/integerTypes.hpp.udiff.html
> Okay, seeing this change, I have to prefer the cast using union. That's super simple and disturbing in it's power.  Thank you for the commentary before it.
> The incremental change looks good.  I've reviewed this enough to be glad when it's pushed, once all the platforms are verified.


More information about the hotspot-dev mailing list