This is a trivial improvement for gen_continuation_enter on aarch64.
We can combine Compare and Branch on Zero/Nonzero into CBZ/CBNZ to save one instruction.
Proposed fix:
diff --git a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
index 55a49594fb3..2640157a818 100644
--- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
@@ -1050,8 +1050,7 @@ static void gen_continuation_enter(MacroAssembler* masm,
fill_continuation_entry(masm);
- __ cmp(c_rarg2, (u1)0);
- __ br(Assembler::NE, call_thaw);
+ __ cbnz(c_rarg2, call_thaw);
address mark = __ pc();
__ trampoline_call(resolve);
@@ -1076,8 +1075,7 @@ static void gen_continuation_enter(MacroAssembler* masm,
fill_continuation_entry(masm);
- __ cmp(c_rarg2, (u1)0);
- __ br(Assembler::NE, call_thaw);
+ __ cbnz(c_rarg2, call_thaw);
address mark = __ pc();
__ trampoline_call(resolve);
We can combine Compare and Branch on Zero/Nonzero into CBZ/CBNZ to save one instruction.
Proposed fix:
diff --git a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
index 55a49594fb3..2640157a818 100644
--- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
@@ -1050,8 +1050,7 @@ static void gen_continuation_enter(MacroAssembler* masm,
fill_continuation_entry(masm);
- __ cmp(c_rarg2, (u1)0);
- __ br(Assembler::NE, call_thaw);
+ __ cbnz(c_rarg2, call_thaw);
address mark = __ pc();
__ trampoline_call(resolve);
@@ -1076,8 +1075,7 @@ static void gen_continuation_enter(MacroAssembler* masm,
fill_continuation_entry(masm);
- __ cmp(c_rarg2, (u1)0);
- __ br(Assembler::NE, call_thaw);
+ __ cbnz(c_rarg2, call_thaw);
address mark = __ pc();
__ trampoline_call(resolve);