Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1780,12 +1780,10 @@ void CallArgs::AddFinalArgsAndDetermineABIInfo(Compiler* comp, GenTreeCall* call
// Push the stub address onto the list of arguments.
NewCallArg indirCellAddrArg =
NewCallArg::Primitive(indirectCellAddress).WellKnown(WellKnownArg::R2RIndirectionCell);
#ifdef TARGET_WASM
// On wasm we need to ensure we put the indirection cell address last in LIR, after the SP and formal args.
// On wasm we need to ensure we put the indirection cell address last in LIR, after the SP and formal args,
// because it is used as the portable entry point (PEP) which is the last argument slot. On other targets
// it shouldn't matter whether we evaluate the argument early or late since it goes into a dedicated register.
PushBack(comp, indirCellAddrArg);
#else
InsertAfterThisOrFirst(comp, indirCellAddrArg);
#endif // TARGET_WASM
}
#endif // defined(FEATURE_READYTORUN)

Expand Down
Loading