From 7c695e7f930f7473b3cf44de271e2fea2aa4f955 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Tue, 17 Mar 2026 12:14:12 -0700 Subject: [PATCH] Try pushing it to the back everywhere --- src/coreclr/jit/morph.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index 7360b98dfc6483..523dc3a775dc06 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -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)