[RyuJIT/ARM32] [ReadyToRun] Fix target register for invocation to Thunk
authorHyeongseok Oh <hseok82.oh@samsung.com>
Mon, 3 Apr 2017 06:16:43 +0000 (15:16 +0900)
committerHyeongseok Oh <hseok82.oh@samsung.com>
Mon, 3 Apr 2017 06:16:43 +0000 (15:16 +0900)
Fix target register for invocation to Thunk code from generated by ReadyToRun
Target register: REG_VIRTUAL_STUB_PARAM (R4, same as LegacyJIT)

Commit migrated from https://github.com/dotnet/coreclr/commit/9c2213765abc56f98dcb59d4567912dc5ac1e137

src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/lower.cpp

index 4e42f4f..4f1b724 100644 (file)
@@ -5524,11 +5524,16 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree)
             }
 
 #ifdef FEATURE_READYTORUN_COMPILER
-#ifdef _TARGET_ARM64_
+#if defined(_TARGET_ARM64_)
             if (tree->gtCall.IsR2RRelativeIndir())
             {
                 ftreg |= RBM_R2R_INDIRECT_PARAM;
             }
+#elif defined(_TARGET_ARM_)
+            if (tree->gtCall.IsR2RRelativeIndir())
+            {
+                ftreg |= RBM_JUMP_THUNK_PARAM;
+            }
 #endif
 #endif
 
index 5aad06a..487054e 100644 (file)
@@ -2554,6 +2554,7 @@ GenTree* Lowering::LowerDirectCall(GenTreeCall* call)
             if (call->IsR2RRelativeIndir())
             {
                 cellAddr->gtRegNum = REG_JUMP_THUNK_PARAM;
+                indir->gtRegNum    = REG_VIRTUAL_STUB_PARAM;
             }
 #endif
 #endif