Skip to content

Commit 617bdee

Browse files
committed
[GR-79055] Fix interpreter stub prologue ordering on AMD64
PullRequest: graal/25172
2 parents 5036eb1 + 991fb50 commit 617bdee

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

substratevm/src/com.oracle.svm.core.graal.amd64/src/com/oracle/svm/core/graal/amd64/AMD64InterpreterStubs.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ private static void emitVTableInstalledCodeFastPath(AMD64MacroAssembler masm, Re
283283
public void enter(CompilationResultBuilder crb) {
284284
AMD64MacroAssembler masm = (AMD64MacroAssembler) crb.asm;
285285

286+
/*
287+
* Optional fast paths are emitted before the regular prologue, so mark the start of
288+
* this routine as an indirect target.
289+
*/
290+
masm.maybeEmitIndirectTargetMarker();
291+
286292
List<Register> gps = getRegisterConfig().getJavaGeneralParameterRegs();
287293
List<Register> fps = getRegisterConfig().getFloatingPointParameterRegs();
288294

@@ -366,6 +372,11 @@ public void enter(CompilationResultBuilder crb) {
366372
List<Register> fps = registerConfig.getFloatingPointParameterRegs();
367373
Register originalSp = r11;
368374

375+
/*
376+
* Since the caller stack pointer is saved before the regular prologue, we must mark
377+
* the start of this routine as an indirect target.
378+
*/
379+
masm.maybeEmitIndirectTargetMarker();
369380
/* Preserve the caller stack pointer before the regular prologue allocates the frame. */
370381
masm.movq(originalSp, rsp);
371382
super.enter(crb);

0 commit comments

Comments
 (0)