src/hotspot/cpu/zero/cppInterpreter_zero.cpp
changeset 47634 6a0c42c40cd1
parent 47216 71c04702a3d5
child 47687 fb290fd1f9d4
--- a/src/hotspot/cpu/zero/cppInterpreter_zero.cpp	Mon Oct 16 20:22:41 2017 +0000
+++ b/src/hotspot/cpu/zero/cppInterpreter_zero.cpp	Mon Oct 16 22:36:06 2017 -0400
@@ -276,7 +276,7 @@
     markOop disp = lockee->mark()->set_unlocked();
 
     monitor->lock()->set_displaced_header(disp);
-    if (Atomic::cmpxchg_ptr(monitor, lockee->mark_addr(), disp) != disp) {
+    if (Atomic::cmpxchg((markOop)monitor, lockee->mark_addr(), disp) != disp) {
       if (thread->is_lock_owned((address) disp->clear_lock_bits())) {
         monitor->lock()->set_displaced_header(NULL);
       }
@@ -420,7 +420,8 @@
     monitor->set_obj(NULL);
 
     if (header != NULL) {
-      if (Atomic::cmpxchg_ptr(header, rcvr->mark_addr(), lock) != lock) {
+      markOop old_header = markOopDesc::encode(lock);
+      if (rcvr->cas_set_mark(header, old_header) != old_header) {
         monitor->set_obj(rcvr); {
           HandleMark hm(thread);
           CALL_VM_NOCHECK(InterpreterRuntime::monitorexit(thread, monitor));