This is a point fix for not allowing fast tail calls on windows arm64 for vararg...
authorJarret Shook <jashoo@microsoft.com>
Tue, 14 Jan 2020 18:35:01 +0000 (10:35 -0800)
committerAnirudh Agnihotry <anirudhagnihotry098@gmail.com>
Tue, 14 Jan 2020 18:35:01 +0000 (10:35 -0800)
* This is a point fix for not allowing fast tail calls on windows arm64

This only affects windows arm and arm64.

* Fix build break

src/jit/morph.cpp

index c087fb0..dfea9e7 100644 (file)
@@ -7047,6 +7047,19 @@ bool Compiler::fgCanFastTailCall(GenTreeCall* callee)
     // out-going area required for callee is bounded by caller's fixed argument space.
     //
     // Note that callee being a vararg method is not a problem since we can account the params being passed.
+    //
+    // We will currently decide to not fast tail call on Windows armarch if the caller or callee is a vararg
+    // method. This is due to the ABI differences for native vararg methods for these platforms. There is
+    // work required to shuffle arguments to the correct locations.
+
+#if (defined(_TARGET_WINDOWS_) && defined(_TARGET_ARM_)) || (defined(_TARGET_WINDOWS_) && defined(_TARGET_ARM64_))
+    if (info.compIsVarArgs || callee->IsVarargs())
+    {
+        reportFastTailCallDecision("Fast tail calls with varargs not supported on Windows ARM/ARM64", 0, 0);
+        return false;
+    }
+#endif // (defined(_TARGET_WINDOWS_) && defined(_TARGET_ARM_)) || defined(_TARGET_WINDOWS_) && defined(_TARGET_ARM64_))
+
     unsigned nCallerArgs = info.compArgsCount;
 
     size_t callerArgRegCount      = codeGen->intRegState.rsCalleeRegArgCount;