Skip to content

Commit 2ce32ef

Browse files
committed
Do not emit speculation barrier instruction if the relevant CPU feature is not supported
1 parent 2f032dd commit 2ce32ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/asm/aarch64/AArch64Assembler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4082,7 +4082,9 @@ public void msr(SystemRegister systemRegister, Register src) {
40824082
* C6.2.230 Speculation barrier.
40834083
*/
40844084
public void sb() {
4085-
emitInt(SB.encoding | BarrierOp);
4085+
if (supports(CPUFeature.SB)) {
4086+
emitInt(SB.encoding | BarrierOp);
4087+
}
40864088
}
40874089

40884090
public void annotatePatchingImmediate(int pos, Instruction instruction, int operandSizeBits, int offsetBits, int shift) {

0 commit comments

Comments
 (0)