@@ -2739,14 +2739,14 @@ void MacroAssembler::compiler_fast_unlock_object(ConditionRegister flag, Registe
2739
2739
// Check if there is a successor.
2740
2740
ld (temp, in_bytes (ObjectMonitor::succ_offset ()), current_header);
2741
2741
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.
2743
2745
2744
2746
// Save the monitor pointer in the current thread, so we can try
2745
2747
// to reacquire the lock in SharedRuntime::monitor_exit_helper().
2746
2748
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
2750
2750
2751
2751
// flag == EQ indicates success, decrement held monitor count
2752
2752
// flag == NE indicates failure
@@ -3053,7 +3053,6 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(ConditionRegister f
3053
3053
3054
3054
bind (not_recursive);
3055
3055
3056
- Label set_eq_unlocked;
3057
3056
const Register t2 = tmp2;
3058
3057
3059
3058
// Set owner to null.
@@ -3075,17 +3074,14 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(ConditionRegister f
3075
3074
// Check if there is a successor.
3076
3075
ld (t, in_bytes (ObjectMonitor::succ_offset ()), monitor);
3077
3076
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.
3079
3080
3080
3081
// Save the monitor pointer in the current thread, so we can try
3081
3082
// to reacquire the lock in SharedRuntime::monitor_exit_helper().
3082
3083
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
3089
3085
}
3090
3086
3091
3087
bind (unlocked);
0 commit comments