RFR: 8186476: Generalize Atomic::add with templates

Andrew Haley aph at redhat.com
Tue Aug 22 09:06:43 UTC 2017


On 21/08/17 14:10, Erik Österlund wrote:
> When it comes to the proposed Atomic::add implementation, it seems to me 
> like the emulation of Atomic::add on jshort using jint is very similar 
> to how Atomic::cmpxchg on jbyte is emulated using jint. So it surprised 
> me a bit that Atomic::add of jshort does not share the same mechanism as 
> the generalized Atomic::cmpxchg of jbyte.

Indeed.  It also seems rather weird to jump through these hoops on
targets which do have support for adds on jshort.  Still, as you say
it's only used in once place and I guess it doesn't hurt.  I don't
like the undefined behaviour there, though.  It would be nice if there
were none on targets with proper support.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the hotspot-dev mailing list