--- 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));