diff options
author | SaeHie Park <saehie.park@gmail.com> | 2017-02-14 23:55:45 +0900 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2017-02-14 15:55:45 +0100 |
commit | c055f7ba7d85347e1cb88937964f39d96b12d79e (patch) | |
tree | 846f271aa4b797a751203c67c9c7a62374479d28 /src/vm/prestub.cpp | |
parent | daeb6927dc006fcda24aa3c7384f57da18a95191 (diff) | |
download | coreclr-c055f7ba7d85347e1cb88937964f39d96b12d79e.tar.gz coreclr-c055f7ba7d85347e1cb88937964f39d96b12d79e.tar.bz2 coreclr-c055f7ba7d85347e1cb88937964f39d96b12d79e.zip |
[x86/Linux] Fix IL Stub for Shared Generic (#9571)
Fix parameter order in UnboxingILStub for Shared Generic
Diffstat (limited to 'src/vm/prestub.cpp')
-rw-r--r-- | src/vm/prestub.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/vm/prestub.cpp b/src/vm/prestub.cpp index 8a2396d88f..8e158d2fb9 100644 --- a/src/vm/prestub.cpp +++ b/src/vm/prestub.cpp @@ -731,14 +731,22 @@ Stub * CreateUnboxingILStubForSharedGenericValueTypeMethods(MethodDesc* pTargetM // 2. Emit the method body mdToken tokPinningHelper = pCode->GetToken(MscorlibBinder::GetField(FIELD__PINNING_HELPER__M_DATA)); - + // 2.1 Push the thisptr // We need to skip over the MethodTable* - // The trick below will do that. + // The trick below will do that. pCode->EmitLoadThis(); pCode->EmitLDFLDA(tokPinningHelper); - // 2.2 Push the hidden context param +#if defined(_TARGET_X86_) + // 2.2 Push the rest of the arguments for x86 + for (unsigned i = 0; i < msig.NumFixedArgs();i++) + { + pCode->EmitLDARG(i); + } +#endif + + // 2.3 Push the hidden context param // The context is going to be captured from the thisptr pCode->EmitLoadThis(); pCode->EmitLDFLDA(tokPinningHelper); @@ -746,16 +754,18 @@ Stub * CreateUnboxingILStubForSharedGenericValueTypeMethods(MethodDesc* pTargetM pCode->EmitSUB(); pCode->EmitLDIND_I(); - // 2.3 Push the rest of the arguments +#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); } +#endif - // 2.4 Push the target address + // 2.5 Push the target address pCode->EmitLDC((TADDR)pTargetMD->GetMultiCallableAddrOfCode(CORINFO_ACCESS_ANY)); - // 2.5 Do the calli + // 2.6 Do the calli pCode->EmitCALLI(TOKEN_ILSTUB_TARGET_SIG, msig.NumFixedArgs() + 1, msig.IsReturnTypeVoid() ? 0 : 1); pCode->EmitRET(); |