# HG changeset patch # Parent a137bdf9f50c802cb32ba55ed7c5326a685236b6 diff -r a137bdf9f50c -r d62b0355010d src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp --- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp Mon Sep 30 22:39:11 2019 +0200 +++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp Fri Oct 04 09:42:56 2019 +0200 @@ -619,21 +619,26 @@ // with to-space ptr store. We still have to do the retry, because the GC might // have updated the reference for us. + if (os::is_MP()) __ lock(); +#ifdef _LP64 + if (UseCompressedOops) { + __ cmpxchgl(newval, addr); + } else +#endif + { + __ cmpxchgptr(newval, addr); + } + + __ jcc(Assembler::equal, L_success); + #ifdef _LP64 if (UseCompressedOops) { __ encode_heap_oop(tmp2); // previously decoded at step 2. } #endif - if (os::is_MP()) __ lock(); -#ifdef _LP64 - if (UseCompressedOops) { - __ cmpxchgl(tmp2, addr); - } else -#endif - { - __ cmpxchgptr(tmp2, addr); - } + __ cmpptr(oldval, tmp2); + __ jccb(Assembler::notEqual, L_failure); // Step 4. Try to CAS again. // @@ -642,15 +647,6 @@ // from-space ptr into memory anymore. Make sure oldval is restored, after being // garbled during retries. // -#ifdef _LP64 - if (UseCompressedOops) { - __ movl(oldval, tmp2); - } else -#endif - { - __ movptr(oldval, tmp2); - } - if (os::is_MP()) __ lock(); #ifdef _LP64 if (UseCompressedOops) {