summaryrefslogtreecommitdiff
path: root/src/jit/codegencommon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jit/codegencommon.cpp')
-rwxr-xr-xsrc/jit/codegencommon.cpp84
1 files changed, 45 insertions, 39 deletions
diff --git a/src/jit/codegencommon.cpp b/src/jit/codegencommon.cpp
index 35360394fb..562fc08ee3 100755
--- a/src/jit/codegencommon.cpp
+++ b/src/jit/codegencommon.cpp
@@ -4074,7 +4074,7 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg,
slots = 1;
#if FEATURE_MULTIREG_ARGS
- if (varDsc->lvIsMultiregStruct())
+ if (compiler->lvaIsMultiregStruct(varDsc))
{
if (varDsc->lvIsHfaRegArg())
{
@@ -9006,20 +9006,20 @@ void CodeGen::genFnEpilog(BasicBlock* block)
*/
getEmitter()->emitIns_Call(callType,
- methHnd,
- INDEBUG_LDISASM_COMMA(nullptr)
- addr,
- 0, // argSize
- EA_UNKNOWN, // retSize
- gcInfo.gcVarPtrSetCur,
- gcInfo.gcRegGCrefSetCur,
- gcInfo.gcRegByrefSetCur,
- BAD_IL_OFFSET, // IL offset
- indCallReg, // ireg
- REG_NA, // xreg
- 0, // xmul
- 0, // disp
- true); // isJump
+ methHnd,
+ INDEBUG_LDISASM_COMMA(nullptr)
+ addr,
+ 0, // argSize
+ EA_UNKNOWN, // retSize
+ gcInfo.gcVarPtrSetCur,
+ gcInfo.gcRegGCrefSetCur,
+ gcInfo.gcRegByrefSetCur,
+ BAD_IL_OFFSET, // IL offset
+ indCallReg, // ireg
+ REG_NA, // xreg
+ 0, // xmul
+ 0, // disp
+ true); // isJump
}
else
{
@@ -9115,16 +9115,17 @@ void CodeGen::genFnEpilog(BasicBlock* block)
// Simply emit a jump to the methodHnd. This is similar to a call so we can use
// the same descriptor with some minor adjustments.
getEmitter()->emitIns_Call(callType,
- methHnd,
- INDEBUG_LDISASM_COMMA(nullptr)
- addrInfo.addr,
- 0, // argSize
- EA_UNKNOWN, // retSize
- gcInfo.gcVarPtrSetCur,
- gcInfo.gcRegGCrefSetCur,
- gcInfo.gcRegByrefSetCur,
- BAD_IL_OFFSET, REG_NA, REG_NA, 0, 0, /* iloffset, ireg, xreg, xmul, disp */
- true); /* isJump */
+ methHnd,
+ INDEBUG_LDISASM_COMMA(nullptr)
+ addrInfo.addr,
+ 0, // argSize
+ EA_UNKNOWN, // retSize
+ EA_UNKNOWN, // secondRetSize
+ gcInfo.gcVarPtrSetCur,
+ gcInfo.gcRegGCrefSetCur,
+ gcInfo.gcRegByrefSetCur,
+ BAD_IL_OFFSET, REG_NA, REG_NA, 0, 0, /* iloffset, ireg, xreg, xmul, disp */
+ true); /* isJump */
}
#if FEATURE_FASTTAILCALL
else
@@ -10472,22 +10473,26 @@ void CodeGen::genRestoreCalleeSavedFltRegs(unsigned lclFrameSize)
}
#endif // defined(_TARGET_XARCH_) && !FEATURE_STACK_FP_X87
-#ifdef FEATURE_UNIX_AMD64_STRUCT_PASSING
-bool Compiler::IsRegisterPassable(CORINFO_CLASS_HANDLE hClass)
+//-----------------------------------------------------------------------------------
+// IsMultiRegPassedType: Returns true if the type is returned in multiple registers
+//
+// Arguments:
+// hClass - type handle
+//
+// Return Value:
+// true if type is passed in multiple registers, false otherwise.
+//
+bool Compiler::IsMultiRegPassedType(CORINFO_CLASS_HANDLE hClass)
{
if (hClass == NO_CLASS_HANDLE)
{
return false;
}
- SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR structDesc;
- eeGetSystemVAmd64PassStructInRegisterDescriptor(hClass, &structDesc);
- return structDesc.passedInRegisters;
-}
-
-bool Compiler::IsRegisterPassable(GenTreePtr tree)
-{
- return IsRegisterPassable(gtGetStructHandleIfPresent(tree));
+ structPassingKind howToPassStruct;
+ var_types returnType = getArgTypeForStruct(hClass, &howToPassStruct);
+
+ return (returnType == TYP_STRUCT);
}
//-----------------------------------------------------------------------------------
@@ -10498,6 +10503,7 @@ bool Compiler::IsRegisterPassable(GenTreePtr tree)
//
// Return Value:
// true if type is returned in multiple registers, false otherwise.
+//
bool Compiler::IsMultiRegReturnedType(CORINFO_CLASS_HANDLE hClass)
{
if (hClass == NO_CLASS_HANDLE)
@@ -10505,11 +10511,11 @@ bool Compiler::IsMultiRegReturnedType(CORINFO_CLASS_HANDLE hClass)
return false;
}
- SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR structDesc;
- eeGetSystemVAmd64PassStructInRegisterDescriptor(hClass, &structDesc);
- return structDesc.passedInRegisters && (structDesc.eightByteCount > 1);
+ structPassingKind howToReturnStruct;
+ var_types returnType = getReturnTypeForStruct(hClass, &howToReturnStruct);
+
+ return (returnType == TYP_STRUCT);
}
-#endif // FEATURE_UNIX_AMD64_STRUCT_PASSING
//----------------------------------------------
// Methods that support HFA's for ARM32/ARM64