[Ryujit/ARM32][ReadyToRun] Fix invocation to Thunk (dotnet/coreclr#10348)
authorHyung-Kyu Choi <hqueue@users.noreply.github.com>
Thu, 30 Mar 2017 22:40:19 +0000 (07:40 +0900)
committerJan Kotas <jkotas@microsoft.com>
Thu, 30 Mar 2017 22:40:19 +0000 (15:40 -0700)
Fix invocation to Thunk code from code generated from ReadyToRun.
Thunk code for ARM32 accept r12 as a parameter.

Signed-off-by: Hyung-Kyu Choi <hk0110.choi@samsung.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/99adda23317d943eb2644ffd87798e0e264d426b

src/coreclr/src/jit/lower.cpp

index 573de3a..5aad06a 100644 (file)
@@ -2542,7 +2542,7 @@ GenTree* Lowering::LowerDirectCall(GenTreeCall* call)
             GenTree* indir    = Ind(cellAddr);
 
 #ifdef FEATURE_READYTORUN_COMPILER
-#ifdef _TARGET_ARM64_
+#if defined(_TARGET_ARM64_)
             // For arm64, we dispatch code same as VSD using X11 for indirection cell address,
             // which ZapIndirectHelperThunk expects.
             if (call->IsR2RRelativeIndir())
@@ -2550,6 +2550,11 @@ GenTree* Lowering::LowerDirectCall(GenTreeCall* call)
                 cellAddr->gtRegNum = REG_R2R_INDIRECT_PARAM;
                 indir->gtRegNum    = REG_JUMP_THUNK_PARAM;
             }
+#elif defined(_TARGET_ARM_)
+            if (call->IsR2RRelativeIndir())
+            {
+                cellAddr->gtRegNum = REG_JUMP_THUNK_PARAM;
+            }
 #endif
 #endif
             result = indir;