@@ -2739,14 +2739,14 @@ void MacroAssembler::compiler_fast_unlock_object(ConditionRegister flag, Registe
27392739 // Check if there is a successor.
27402740 ld (temp, in_bytes (ObjectMonitor::succ_offset ()), current_header);
27412741 cmpdi (flag, temp, 0 );
2742- bne (flag, success); // If so we are done.
2742+ // Invert equal bit
2743+ crnand (flag, Assembler::equal, flag, Assembler::equal);
2744+ beq (flag, success); // If there is a successor we are done.
27432745
27442746 // Save the monitor pointer in the current thread, so we can try
27452747 // to reacquire the lock in SharedRuntime::monitor_exit_helper().
27462748 std (current_header, in_bytes (JavaThread::unlocked_inflated_monitor_offset ()), R16_thread);
2747-
2748- crxor (flag, Assembler::equal, flag, Assembler::equal); // Set flag = NE => slow path
2749- b (failure);
2749+ b (failure); // flag == NE
27502750
27512751 // flag == EQ indicates success, decrement held monitor count
27522752 // flag == NE indicates failure
@@ -3053,7 +3053,6 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(ConditionRegister f
30533053
30543054 bind (not_recursive);
30553055
3056- Label set_eq_unlocked;
30573056 const Register t2 = tmp2;
30583057
30593058 // Set owner to null.
@@ -3075,17 +3074,14 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(ConditionRegister f
30753074 // Check if there is a successor.
30763075 ld (t, in_bytes (ObjectMonitor::succ_offset ()), monitor);
30773076 cmpdi (CCR0, t, 0 );
3078- bne (CCR0, set_eq_unlocked); // If so we are done.
3077+ // Invert equal bit
3078+ crnand (flag, Assembler::equal, flag, Assembler::equal);
3079+ beq (CCR0, unlocked); // If there is a successor we are done.
30793080
30803081 // Save the monitor pointer in the current thread, so we can try
30813082 // to reacquire the lock in SharedRuntime::monitor_exit_helper().
30823083 std (monitor, in_bytes (JavaThread::unlocked_inflated_monitor_offset ()), R16_thread);
3083-
3084- crxor (CCR0, Assembler::equal, CCR0, Assembler::equal); // Set flag = NE => slow path
3085- b (slow_path);
3086-
3087- bind (set_eq_unlocked);
3088- crorc (CCR0, Assembler::equal, CCR0, Assembler::equal); // Set flag = EQ => fast path
3084+ b (slow_path); // flag == NE
30893085 }
30903086
30913087 bind (unlocked);
0 commit comments