|
24 | 24 | */ |
25 | 25 | package jdk.graal.compiler.lir.amd64; |
26 | 26 |
|
| 27 | +import static jdk.graal.compiler.asm.amd64.AMD64MacroAssembler.ExtendMode.ZERO_EXTEND; |
27 | 28 | import static jdk.vm.ci.amd64.AMD64.r8; |
28 | 29 | import static jdk.vm.ci.amd64.AMD64.rax; |
29 | 30 | import static jdk.vm.ci.amd64.AMD64.rcx; |
|
33 | 34 | import static jdk.vm.ci.code.ValueUtil.asRegister; |
34 | 35 | import static jdk.vm.ci.code.ValueUtil.isRegister; |
35 | 36 | import static jdk.vm.ci.code.ValueUtil.isStackSlot; |
36 | | -import static jdk.graal.compiler.asm.amd64.AMD64MacroAssembler.ExtendMode.ZERO_EXTEND; |
37 | 37 |
|
38 | 38 | import java.util.EnumSet; |
39 | 39 |
|
|
56 | 56 | import jdk.graal.compiler.lir.Opcode; |
57 | 57 | import jdk.graal.compiler.lir.asm.CompilationResultBuilder; |
58 | 58 | import jdk.graal.compiler.lir.gen.LIRGeneratorTool; |
59 | | - |
60 | 59 | import jdk.vm.ci.amd64.AMD64.CPUFeature; |
61 | 60 | import jdk.vm.ci.amd64.AMD64Kind; |
62 | 61 | import jdk.vm.ci.code.Register; |
@@ -431,8 +430,12 @@ public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler asm) { |
431 | 430 | asm.addq(index, bulkSize); |
432 | 431 |
|
433 | 432 | boolean bulkLoopShortJmp = !((variant == LIRGeneratorTool.ArrayIndexOfVariant.MatchRange && nValues == 4 || variant == LIRGeneratorTool.ArrayIndexOfVariant.Table) && stride.value > 1); |
434 | | - // check if there are enough array slots remaining for the bulk loop |
435 | | - asm.cmpqAndJcc(index, arrayLength, ConditionFlag.Greater, skipBulkVectorLoop, bulkLoopShortJmp); |
| 433 | + /* |
| 434 | + * Check if there are enough array slots remaining for the bulk loop. Note: The alignment |
| 435 | + * following the cmpAndJcc can lead to a jump distance > 127. This prevents safely using a |
| 436 | + * short jump. |
| 437 | + */ |
| 438 | + asm.cmpqAndJcc(index, arrayLength, ConditionFlag.Greater, skipBulkVectorLoop, false); |
436 | 439 |
|
437 | 440 | asm.align(preferredLoopAlignment(crb)); |
438 | 441 | asm.bind(bulkVectorLoop); |
|
0 commit comments