Skip to content

Commit 8ecca06

Browse files
committed
Insert stackmaps after (not before) calls.
This is so that the offset of the stackmap entry will record the instruction after the call, which is where we want to continue after deoptimisation.
1 parent fb45fc6 commit 8ecca06

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Transforms/Yk/StackMaps.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ class YkStackmaps : public ModulePass {
7373
for (Value *A : L)
7474
Args.push_back(A);
7575

76+
if (isa<CallInst>(I)) {
77+
// Insert the stackmap call after (not before) the call instruction, so
78+
// the offset of the stackmap entry will record the instruction after
79+
// the call, which is where we want to continue after deoptimisation.
80+
Bldr.SetInsertPoint(I->getNextNonDebugInstruction());
81+
}
7682
Bldr.CreateCall(SMFunc->getFunctionType(), SMFunc,
7783
ArrayRef<Value *>(Args));
7884
Count++;

0 commit comments

Comments
 (0)