C2 compare and swap fixes
Roman Kennke
rkennke at redhat.com
Fri Jun 3 14:49:50 UTC 2016
Hi Roland,
Am Freitag, den 03.06.2016, 16:32 +0200 schrieb Roland Westrelin:
> http://cr.openjdk.java.net/~roland/shenandoah-cas/webrev.00/
>
> implements compare and swap on x86 and aarch64 (and compare and
> exchange
> on x86) as a tight loop in the ad file. The previous implementation
> as a
> series of 3 CompareAndSwapP IR nodes was flawed because in rare cases
> it
> can take more than 3 attempts for a valid CAS to succeed. That webrev
> also includes a few aarch64 only changes that are required for
> aarch64
> to build again.
Looks mostly good to me.
I believe we don't have to match WeakCompareAndSwap. As far as I
understand it, Weak-CAS can fail for unknown reasons. In our case, it
should be ok to fail when comparing from- and to-space objects. I am
not 100% sure about it though. Would be good to have a testcase or
consult somebody who knows for sure.
In library_call.cpp, you can remove a couple more changes that I made.
I added the need_mem and result stuff IIRC. Best to diff that method
with upstream jdk9 and restore the original state.
Roman
More information about the shenandoah-dev
mailing list