src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp
changeset 58407 b14643d898d3
parent 58273 08a5148e7c4e
child 58679 9c3209ff7550
child 58693 3f35a9efd7de
--- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp	Mon Sep 30 17:18:30 2019 +0200
+++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp	Mon Sep 30 18:02:24 2019 +0200
@@ -271,9 +271,14 @@
   if (borrow_reg) {
     // No free registers available. Make one useful.
     tmp = LP64_ONLY(rscratch1) NOT_LP64(rdx);
+    if (tmp == dst) {
+      tmp = LP64_ONLY(rscratch2) NOT_LP64(rcx);
+    }
     __ push(tmp);
   }
 
+  assert_different_registers(dst, tmp);
+
   Label done;
   __ movptr(tmp, Address(dst, oopDesc::mark_offset_in_bytes()));
   __ notptr(tmp);