summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSaeHie Park <saehie.park@gmail.com>2017-02-15 14:12:06 +0900
committerJan Kotas <jkotas@microsoft.com>2017-02-14 22:12:06 -0700
commitbeaf718cc6e3a0e786191ce322839e66619b5a54 (patch)
tree0a7c93f389a992572d82776d50e38d52048cc844 /src
parent4e992df6ea9dd6c2dffe0f471f7def62da66475d (diff)
downloadcoreclr-beaf718cc6e3a0e786191ce322839e66619b5a54.tar.gz
coreclr-beaf718cc6e3a0e786191ce322839e66619b5a54.tar.bz2
coreclr-beaf718cc6e3a0e786191ce322839e66619b5a54.zip
[x86/Linux] Fix CreateInstantiatingILStub (#9590)
The hidden argument should be always passed last for x86
Diffstat (limited to 'src')
-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 8e158d2fb9..67a184f4af 100644
--- a/src/vm/prestub.cpp
+++ b/src/vm/prestub.cpp
@@ -838,39 +838,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));