Single byte Atomic::cmpxchg implementation

Mikael Gerdin mikael.gerdin at oracle.com
Thu Sep 4 09:20:06 UTC 2014


Hi Erik,

On Thursday 04 September 2014 09.05.13 Erik Österlund wrote:
> Hi,
> 
> The implementation of single byte Atomic::cmpxchg on x86 (and all other
> platforms) emulates the single byte cmpxchgb instruction using a loop of
> jint-sized load and cmpxchgl and code to dynamically align the destination
> address.
> 
> This code is used for GC-code related to remembered sets currently.
> 
> I have the changes on my platform (amd64, bsd) to simply use the native
> cmpxchgb instead but could provide a patch fixing this unnecessary
> performance glitch for all supported x86 if anybody wants this?

I think that sounds good.
Would you mind looking at other cpu arches to see if they provide something 
similar? It's ok if you can't build the code for the other arches, I can help 
you with that.

/Mikael

> 
> /Erik



More information about the hotspot-dev mailing list