[RyuJIT/ARM32] Fast tail call: Init LSRA to use R12 to save jump target (#14184)
authorHyeongseok Oh <hseok82.oh@samsung.com>
Wed, 27 Sep 2017 04:20:06 +0000 (13:20 +0900)
committerBruce Forstall <brucefo@microsoft.com>
Wed, 27 Sep 2017 04:20:06 +0000 (21:20 -0700)
* [RyuJIT/ARM32] Fast tail call: use R12 to save jump target

To save jump target of fast tail call on ARM32, we use r12.

* Use pre-defined mask and fix comment

Use pre-defined mask: RBM_R12
fix comment: mov pc -> br

src/jit/lsraarmarch.cpp

index a739cc9..53e223d 100644 (file)
@@ -400,13 +400,15 @@ void LinearScan::TreeNodeInfoInitCall(GenTreeCall* call)
         // computed into a register.
         if (call->IsFastTailCall())
         {
-            NYI_ARM("tail call");
-
 #ifdef _TARGET_ARM64_
             // Fast tail call - make sure that call target is always computed in IP0
             // so that epilog sequence can generate "br xip0" to achieve fast tail call.
             ctrlExpr->gtLsraInfo.setSrcCandidates(this, genRegMask(REG_IP0));
-#endif // _TARGET_ARM64_
+#else  // !_TARGET_ARM64_
+            // Fast tail call - make sure that call target is always computed in r12
+            // so that epilog sequence can generate "br r12" to achieve fast tail call.
+            ctrlExpr->gtLsraInfo.setSrcCandidates(this, RBM_R12);
+#endif // !_TARGET_ARM64_
         }
     }
 #ifdef _TARGET_ARM_