summaryrefslogtreecommitdiff
path: root/src/vm/prestub.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vm/prestub.cpp')
-rw-r--r--src/vm/prestub.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/vm/prestub.cpp b/src/vm/prestub.cpp
index e52e2b2238..2f84b9df9d 100644
--- a/src/vm/prestub.cpp
+++ b/src/vm/prestub.cpp
@@ -835,39 +835,31 @@ Stub * CreateInstantiatingILStub(MethodDesc* pTargetMD, void* pHiddenArg)
CreateInstantiatingILStubTargetSig(pTargetMD, typeContext, &stubSigBuilder);
// 2. Emit the method body
- unsigned int numArgs = msig.NumFixedArgs();
if (msig.HasThis())
{
// 2.1 Push the thisptr
pCode->EmitLoadThis();
- numArgs++;
}
#if defined(_TARGET_X86_)
- if (numArgs < NUM_ARGUMENT_REGISTERS)
+ // 2.2 Push the rest of the arguments for x86
+ for (unsigned i = 0; i < msig.NumFixedArgs();i++)
{
-#endif // _TARGET_X86_
- // 2.2 Push the hidden context param
- // InstantiatingStub
- pCode->EmitLDC((TADDR)pHiddenArg);
-#if defined(_TARGET_X86_)
+ pCode->EmitLDARG(i);
}
#endif // _TARGET_X86_
- // 2.3 Push the rest of the arguments
+ // 2.3 Push the hidden context param
+ // InstantiatingStub
+ pCode->EmitLDC((TADDR)pHiddenArg);
+
+#if !defined(_TARGET_X86_)
+ // 2.4 Push the rest of the arguments for not x86
for (unsigned i = 0; i < msig.NumFixedArgs();i++)
{
pCode->EmitLDARG(i);
}
-
-#if defined(_TARGET_X86_)
- if (numArgs >= NUM_ARGUMENT_REGISTERS)
- {
- // 2.4 Push the hidden context param
- // InstantiatingStub
- pCode->EmitLDC((TADDR)pHiddenArg);
- }
-#endif // _TARGET_X86_
+#endif // !_TARGET_X86_
// 2.5 Push the target address
pCode->EmitLDC((TADDR)pTargetMD->GetMultiCallableAddrOfCode(CORINFO_ACCESS_ANY));