diff options
author | Bruce Forstall <brucefo@microsoft.com> | 2017-11-27 11:24:59 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-27 11:24:59 -0800 |
commit | 07985712524311aa6c16d2ad0072a6a39892aacc (patch) | |
tree | 9e7e902230f17158dcb852ab7f312c73c47afc6e /src/jit/lower.cpp | |
parent | 93ddc4d563a09b21dd829c8c8a50911a200042f3 (diff) | |
parent | 2486b80099686408c290474edf0327a886e53572 (diff) | |
download | coreclr-07985712524311aa6c16d2ad0072a6a39892aacc.tar.gz coreclr-07985712524311aa6c16d2ad0072a6a39892aacc.tar.bz2 coreclr-07985712524311aa6c16d2ad0072a6a39892aacc.zip |
Merge pull request #15187 from BruceForstall/FixArmTailcall
Fix arm32 stub indirect tailcall
Diffstat (limited to 'src/jit/lower.cpp')
-rw-r--r-- | src/jit/lower.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/jit/lower.cpp b/src/jit/lower.cpp index 1c4cdd4486..65c193fed2 100644 --- a/src/jit/lower.cpp +++ b/src/jit/lower.cpp @@ -4138,12 +4138,27 @@ GenTree* Lowering::LowerVirtualStubCall(GenTreeCall* call) // fgMorphArgs will have created trees to pass the address in VirtualStubParam.reg. // All we have to do here is add an indirection to generate the actual call target. - GenTree* ind = Ind(call->gtCallAddr); + GenTree* ind; + +#ifdef _TARGET_ARM_ + // For ARM, fgMorphTailCall has already made gtCallAddr a GT_IND for virtual stub tail calls. + // (When we eliminate LEGACY_BACKEND maybe we can eliminate this asymmetry?) + if (call->IsTailCallViaHelper()) + { + ind = call->gtCallAddr; + assert(ind->gtOper == GT_IND); + } + else +#endif // _TARGET_ARM_ + { + ind = Ind(call->gtCallAddr); + BlockRange().InsertAfter(call->gtCallAddr, ind); + call->gtCallAddr = ind; + } + ind->gtFlags |= GTF_IND_REQ_ADDR_IN_REG; - BlockRange().InsertAfter(call->gtCallAddr, ind); ContainCheckIndir(ind->AsIndir()); - call->gtCallAddr = ind; } else { |