diff options
author | Lubomir Litchev <LLITCHEV@users.noreply.github.com> | 2016-02-18 23:47:11 -0800 |
---|---|---|
committer | Lubomir Litchev <LLITCHEV@users.noreply.github.com> | 2016-02-18 23:47:11 -0800 |
commit | 5a49e66de150413ad8277bdbc8c2dacf0d461eae (patch) | |
tree | f19849215f454cc795be7e58ed3fcb5198c7dade /src | |
parent | edb8791a974187c27284b72e72ba061dc3a1bbf0 (diff) | |
parent | e46554c494f4ed2c4fda6d3df46eb31f6dc35cdf (diff) | |
download | coreclr-5a49e66de150413ad8277bdbc8c2dacf0d461eae.tar.gz coreclr-5a49e66de150413ad8277bdbc8c2dacf0d461eae.tar.bz2 coreclr-5a49e66de150413ad8277bdbc8c2dacf0d461eae.zip |
Merge pull request #3243 from LLITCHEV/structDesc-clone
Added code to clone the structDesc member of GT_CALL.
Diffstat (limited to 'src')
-rw-r--r-- | src/jit/gentree.cpp | 4 | ||||
-rw-r--r-- | src/jit/gentree.h | 5 | ||||
-rw-r--r-- | src/jit/importer.cpp | 24 |
3 files changed, 15 insertions, 18 deletions
diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp index 3ff8f0857a..8ff8128ecb 100644 --- a/src/jit/gentree.cpp +++ b/src/jit/gentree.cpp @@ -6308,6 +6308,10 @@ GenTreePtr Compiler::gtCloneExpr(GenTree * tree, } copy->gtCall.gtRetClsHnd = tree->gtCall.gtRetClsHnd; +#if defined(FEATURE_UNIX_AMD64_STRUCT_PASSING) + copy->gtCall.structDesc.CopyFrom(tree->gtCall.structDesc); +#endif // defined(FEATURE_UNIX_AMD64_STRUCT_PASSING) + #ifdef FEATURE_READYTORUN_COMPILER copy->gtCall.gtEntryPoint = tree->gtCall.gtEntryPoint; #endif diff --git a/src/jit/gentree.h b/src/jit/gentree.h index 3c3a203136..b11baa20ee 100644 --- a/src/jit/gentree.h +++ b/src/jit/gentree.h @@ -2358,11 +2358,6 @@ struct GenTreeCall final : public GenTree regMaskTP gtCallRegUsedMask; // mask of registers used to pass parameters #ifdef FEATURE_UNIX_AMD64_STRUCT_PASSING SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR structDesc; - - void SetRegisterReturningStructState(const SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR& structDescIn) - { - structDesc.CopyFrom(structDescIn); - } #endif // FEATURE_UNIX_AMD64_STRUCT_PASSING #define GTF_CALL_M_EXPLICIT_TAILCALL 0x0001 // GT_CALL -- the call is "tail" prefixed and importer has performed tail call checks diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp index e4ea4c80dc..7c0581fbe9 100644 --- a/src/jit/importer.cpp +++ b/src/jit/importer.cpp @@ -7045,31 +7045,29 @@ GenTreePtr Compiler::impFixupStructReturn(GenTreePtr call, call->gtCall.gtReturnType = call->gtType; // Get the classification for the struct. - SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR structDesc; - eeGetSystemVAmd64PassStructInRegisterDescriptor(retClsHnd, &structDesc); - if (structDesc.passedInRegisters) + GenTreeCall* callNode = call->AsCall(); + eeGetSystemVAmd64PassStructInRegisterDescriptor(retClsHnd, &(callNode->structDesc)); + if (callNode->structDesc.passedInRegisters) { - call->gtCall.SetRegisterReturningStructState(structDesc); - - if (structDesc.eightByteCount <= 1) + if (callNode->structDesc.eightByteCount <= 1) { - call->gtCall.gtReturnType = getEightByteType(structDesc, 0); + callNode->gtReturnType = getEightByteType(callNode->structDesc, 0); } else { - if (!call->gtCall.CanTailCall() && ((call->gtFlags & GTF_CALL_INLINE_CANDIDATE) == 0)) + if ((!callNode->CanTailCall()) && (!callNode->IsInlineCandidate())) { - // If we can tail call returning in registers struct or inline a method that returns - // a registers returned struct, then don't assign it to - // a variable back and forth. + // No need to assign the struct in two registers to a local var if: + // 1. It is a tail call. + // 2. The call is marked for a later inlining. return impAssignStructClassToVar(call, retClsHnd); } } } else { - call->gtCall.gtCallMoreFlags |= GTF_CALL_M_RETBUFFARG; - } + callNode->gtCallMoreFlags |= GTF_CALL_M_RETBUFFARG; + } return call; #endif // FEATURE_UNIX_AMD64_STRUCT_PASSING |