< prev index next >

src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp

Print this page

        

*** 861,871 **** } else { // template code: // // markOop displaced_header = obj->mark().set_unlocked(); // monitor->lock()->set_displaced_header(displaced_header); ! // if (Atomic::cmpxchg_ptr(/*ex=*/monitor, /*addr*/obj->mark_addr(), /*cmp*/displaced_header) == displaced_header) { // // We stored the monitor address into the object's mark word. // } else if (THREAD->is_lock_owned((address)displaced_header)) // // Simple recursive case. // monitor->lock()->set_displaced_header(NULL); // } else { --- 861,871 ---- } else { // template code: // // markOop displaced_header = obj->mark().set_unlocked(); // monitor->lock()->set_displaced_header(displaced_header); ! // if (Atomic::cmpxchg(/*ex=*/monitor, /*addr*/obj->mark_addr(), /*cmp*/displaced_header) == displaced_header) { // // We stored the monitor address into the object's mark word. // } else if (THREAD->is_lock_owned((address)displaced_header)) // // Simple recursive case. // monitor->lock()->set_displaced_header(NULL); // } else {
*** 899,909 **** // Initialize the box (Must happen before we update the object mark!). std(displaced_header, BasicObjectLock::lock_offset_in_bytes() + BasicLock::displaced_header_offset_in_bytes(), monitor); ! // if (Atomic::cmpxchg_ptr(/*ex=*/monitor, /*addr*/obj->mark_addr(), /*cmp*/displaced_header) == displaced_header) { // Store stack address of the BasicObjectLock (this is monitor) into object. addi(object_mark_addr, object, oopDesc::mark_offset_in_bytes()); // Must fence, otherwise, preceding store(s) may float below cmpxchg. --- 899,909 ---- // Initialize the box (Must happen before we update the object mark!). std(displaced_header, BasicObjectLock::lock_offset_in_bytes() + BasicLock::displaced_header_offset_in_bytes(), monitor); ! // if (Atomic::cmpxchg(/*ex=*/monitor, /*addr*/obj->mark_addr(), /*cmp*/displaced_header) == displaced_header) { // Store stack address of the BasicObjectLock (this is monitor) into object. addi(object_mark_addr, object, oopDesc::mark_offset_in_bytes()); // Must fence, otherwise, preceding store(s) may float below cmpxchg.
*** 975,985 **** // template code: // // if ((displaced_header = monitor->displaced_header()) == NULL) { // // Recursive unlock. Mark the monitor unlocked by setting the object field to NULL. // monitor->set_obj(NULL); ! // } else if (Atomic::cmpxchg_ptr(displaced_header, obj->mark_addr(), monitor) == monitor) { // // We swapped the unlocked mark in displaced_header into the object's mark word. // monitor->set_obj(NULL); // } else { // // Slow path. // InterpreterRuntime::monitorexit(THREAD, monitor); --- 975,985 ---- // template code: // // if ((displaced_header = monitor->displaced_header()) == NULL) { // // Recursive unlock. Mark the monitor unlocked by setting the object field to NULL. // monitor->set_obj(NULL); ! // } else if (Atomic::cmpxchg(displaced_header, obj->mark_addr(), monitor) == monitor) { // // We swapped the unlocked mark in displaced_header into the object's mark word. // monitor->set_obj(NULL); // } else { // // Slow path. // InterpreterRuntime::monitorexit(THREAD, monitor);
*** 1008,1018 **** // If the displaced header is zero, we have a recursive unlock. cmpdi(CCR0, displaced_header, 0); beq(CCR0, free_slot); // recursive unlock ! // } else if (Atomic::cmpxchg_ptr(displaced_header, obj->mark_addr(), monitor) == monitor) { // // We swapped the unlocked mark in displaced_header into the object's mark word. // monitor->set_obj(NULL); // If we still have a lightweight lock, unlock the object and be done. --- 1008,1018 ---- // If the displaced header is zero, we have a recursive unlock. cmpdi(CCR0, displaced_header, 0); beq(CCR0, free_slot); // recursive unlock ! // } else if (Atomic::cmpxchg(displaced_header, obj->mark_addr(), monitor) == monitor) { // // We swapped the unlocked mark in displaced_header into the object's mark word. // monitor->set_obj(NULL); // If we still have a lightweight lock, unlock the object and be done.
< prev index next >