Skip to content

Commit 5f9cddc

Browse files
committed
Use r15 on x64 since it is calee-saved on both Windows/Linux
1 parent 1b44ccd commit 5f9cddc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/Backend/Lower.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29143,10 +29143,11 @@ void Lowerer::LowerGeneratorHelper::InsertNullOutGeneratorFrameInEpilogue(IR::La
2914329143
IR::SymOpnd* srcOpnd = IR::SymOpnd::New(symSrc, TyMachPtr, this->func);
2914429144
IR::RegOpnd* dstOpnd = IR::RegOpnd::New(TyMachReg, this->func);
2914529145

29146-
// callee-save register, we would replace this register in the epilogue anyway
29147-
// so use it as a temp register
29146+
// We would replace the values in all of the callee-saved registers
29147+
// in the epilogue anyway, so use one of them to store the address
29148+
// to our interpreter frame
2914829149
#if defined(_M_X64)
29149-
dstOpnd->SetReg(RegRSI);
29150+
dstOpnd->SetReg(RegR15); // R15 is callee-save on both Windows/Linux
2915029151
#elif defined(_M_IX86)
2915129152
dstOpnd->SetReg(RegESI);
2915229153
#endif

0 commit comments

Comments
 (0)