Skip to content

Commit fa07516

Browse files
rkennketkrodriguez
authored andcommitted
Fix zero-clearing instruction on aarch64
1 parent 4132da2 commit fa07516

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/aarch64/shenandoah/AArch64HotSpotShenandoahCompareAndSwapOp.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,9 @@ public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) {
195195

196196
if (setConditionFlags) {
197197
masm.bind(resultNullFailure);
198-
// Clear zero flag to indicate failure.
199-
masm.subs(32, zr, zr, 1);
198+
// Clear zero flag to indicate failure. We come here knowing that result is null,
199+
// so comparing it to 1 results in the zero (EQ) flag getting cleared.
200+
masm.subs(32, zr, result,1);
200201
masm.jmp(done);
201202
}
202203
});

0 commit comments

Comments
 (0)