for (GenTreeCall::Use& use : call->LateArgs())
{
IndentInfo arcType = (use.GetNext() == nullptr) ? IIArcBottom : IIArc;
- gtGetLateArgMsg(call, use.GetNode(), lateArgIndex, -1, bufp, sizeof(buf));
+ gtGetLateArgMsg(call, use.GetNode(), lateArgIndex, bufp, sizeof(buf));
gtDispChild(use.GetNode(), indentStack, arcType, bufp, topOnly);
lateArgIndex++;
}
// call - The call for which 'arg' is an argument
// arg - The argument for which a message should be constructed
// argNum - The ordinal number of the arg in the argument list
-// listCount - When printing in LIR form this is the count for a GT_FIELD_LIST
-// or -1 if we are not printing in LIR form
// bufp - A pointer to the buffer into which the message is written
// bufLength - The length of the buffer pointed to by bufp
//
// 'call' must be a call node
// 'arg' must be an argument to 'call' (else gtArgEntryByNode will assert)
-void Compiler::gtGetArgMsg(
- GenTreeCall* call, GenTree* arg, unsigned argNum, int listCount, char* bufp, unsigned bufLength)
+void Compiler::gtGetArgMsg(GenTreeCall* call, GenTree* arg, unsigned argNum, char* bufp, unsigned bufLength)
{
if (call->gtCallLateArgs != nullptr)
{
if (curArgTabEntry->IsSplit())
{
regNumber firstReg = curArgTabEntry->GetRegNum();
- if (listCount == -1)
+ if (curArgTabEntry->numRegs == 1)
{
- if (curArgTabEntry->numRegs == 1)
- {
- sprintf_s(bufp, bufLength, "arg%d %s out+%02x%c", argNum, compRegVarName(firstReg),
- (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
- }
- else
- {
- regNumber lastReg = REG_STK;
- char separator = (curArgTabEntry->numRegs == 2) ? ',' : '-';
- if (curArgTabEntry->IsHfaRegArg())
- {
- unsigned lastRegNum = genMapFloatRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
- lastReg = genMapFloatRegArgNumToRegNum(lastRegNum);
- }
- else
- {
- unsigned lastRegNum = genMapIntRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
- lastReg = genMapIntRegArgNumToRegNum(lastRegNum);
- }
- sprintf_s(bufp, bufLength, "arg%d %s%c%s out+%02x%c", argNum, compRegVarName(firstReg),
- separator, compRegVarName(lastReg), (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE,
- 0);
- }
+ sprintf_s(bufp, bufLength, "arg%d %s out+%02x%c", argNum, compRegVarName(firstReg),
+ (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
}
else
{
- unsigned curArgNum = BAD_VAR_NUM;
- bool isFloat = curArgTabEntry->IsHfaRegArg();
- if (isFloat)
- {
- curArgNum = genMapFloatRegNumToRegArgNum(firstReg) + listCount;
- }
- else
- {
- curArgNum = genMapIntRegNumToRegArgNum(firstReg) + listCount;
- }
-
- if (!isFloat && curArgNum < MAX_REG_ARG)
- {
- regNumber curReg = genMapIntRegArgNumToRegNum(curArgNum);
- sprintf_s(bufp, bufLength, "arg%d m%d %s%c", argNum, listCount, compRegVarName(curReg), 0);
- }
- else if (isFloat && curArgNum < MAX_FLOAT_REG_ARG)
+ regNumber lastReg = REG_STK;
+ char separator = (curArgTabEntry->numRegs == 2) ? ',' : '-';
+ if (curArgTabEntry->IsHfaRegArg())
{
- regNumber curReg = genMapFloatRegArgNumToRegNum(curArgNum);
- sprintf_s(bufp, bufLength, "arg%d m%d %s%c", argNum, listCount, compRegVarName(curReg), 0);
+ unsigned lastRegNum = genMapFloatRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
+ lastReg = genMapFloatRegArgNumToRegNum(lastRegNum);
}
else
{
- unsigned stackSlot = listCount - curArgTabEntry->numRegs;
- sprintf_s(bufp, bufLength, "arg%d m%d out+%02x%c", argNum, listCount,
- stackSlot * TARGET_POINTER_SIZE, 0);
+ unsigned lastRegNum = genMapIntRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
+ lastReg = genMapIntRegArgNumToRegNum(lastRegNum);
}
+ sprintf_s(bufp, bufLength, "arg%d %s%c%s out+%02x%c", argNum, compRegVarName(firstReg), separator,
+ compRegVarName(lastReg), (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
}
+
return;
}
#endif // TARGET_ARM
#if FEATURE_FIXED_OUT_ARGS
- if (listCount == -1)
- {
- sprintf_s(bufp, bufLength, "arg%d out+%02x%c", argNum, curArgTabEntry->slotNum * TARGET_POINTER_SIZE,
- 0);
- }
- else // listCount is 0,1,2 or 3
- {
- assert(listCount <= MAX_ARG_REG_COUNT);
- sprintf_s(bufp, bufLength, "arg%d out+%02x%c", argNum,
- (curArgTabEntry->slotNum + listCount) * TARGET_POINTER_SIZE, 0);
- }
+
+ sprintf_s(bufp, bufLength, "arg%d out+%02x%c", argNum, curArgTabEntry->slotNum * TARGET_POINTER_SIZE, 0);
+
#else
sprintf_s(bufp, bufLength, "arg%d on STK%c", argNum, 0);
#endif
// call - The call for which 'arg' is an argument
// argx - The argument for which a message should be constructed
// lateArgIndex - The ordinal number of the arg in the lastArg list
-// listCount - When printing in LIR form this is the count for a multireg GT_FIELD_LIST
-// or -1 if we are not printing in LIR form
// bufp - A pointer to the buffer into which the message is written
// bufLength - The length of the buffer pointed to by bufp
//
// 'call' must be a call node
// 'arg' must be an argument to 'call' (else gtArgEntryByNode will assert)
-void Compiler::gtGetLateArgMsg(
- GenTreeCall* call, GenTree* argx, int lateArgIndex, int listCount, char* bufp, unsigned bufLength)
+void Compiler::gtGetLateArgMsg(GenTreeCall* call, GenTree* argx, int lateArgIndex, char* bufp, unsigned bufLength)
{
assert(!argx->IsArgPlaceHolderNode()); // No place holders nodes are in gtCallLateArgs;
{
regNumber firstReg = curArgTabEntry->GetRegNum();
unsigned argNum = curArgTabEntry->argNum;
- if (listCount == -1)
+ if (curArgTabEntry->numRegs == 1)
{
- if (curArgTabEntry->numRegs == 1)
- {
- sprintf_s(bufp, bufLength, "arg%d %s out+%02x%c", argNum, compRegVarName(firstReg),
- (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
- }
- else
- {
- regNumber lastReg = REG_STK;
- char separator = (curArgTabEntry->numRegs == 2) ? ',' : '-';
- if (curArgTabEntry->IsHfaRegArg())
- {
- unsigned lastRegNum = genMapFloatRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
- lastReg = genMapFloatRegArgNumToRegNum(lastRegNum);
- }
- else
- {
- unsigned lastRegNum = genMapIntRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
- lastReg = genMapIntRegArgNumToRegNum(lastRegNum);
- }
- sprintf_s(bufp, bufLength, "arg%d %s%c%s out+%02x%c", argNum, compRegVarName(firstReg), separator,
- compRegVarName(lastReg), (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
- }
+ sprintf_s(bufp, bufLength, "arg%d %s out+%02x%c", argNum, compRegVarName(firstReg),
+ (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
}
else
{
- unsigned curArgNum = BAD_VAR_NUM;
- bool isFloat = curArgTabEntry->IsHfaRegArg();
- if (isFloat)
+ regNumber lastReg = REG_STK;
+ char separator = (curArgTabEntry->numRegs == 2) ? ',' : '-';
+ if (curArgTabEntry->IsHfaRegArg())
{
- curArgNum = genMapFloatRegNumToRegArgNum(firstReg) + listCount;
+ unsigned lastRegNum = genMapFloatRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
+ lastReg = genMapFloatRegArgNumToRegNum(lastRegNum);
}
else
{
- curArgNum = genMapIntRegNumToRegArgNum(firstReg) + listCount;
- }
-
- if (!isFloat && curArgNum < MAX_REG_ARG)
- {
- regNumber curReg = genMapIntRegArgNumToRegNum(curArgNum);
- sprintf_s(bufp, bufLength, "arg%d m%d %s%c", argNum, listCount, compRegVarName(curReg), 0);
- }
- else if (isFloat && curArgNum < MAX_FLOAT_REG_ARG)
- {
- regNumber curReg = genMapFloatRegArgNumToRegNum(curArgNum);
- sprintf_s(bufp, bufLength, "arg%d m%d %s%c", argNum, listCount, compRegVarName(curReg), 0);
- }
- else
- {
- unsigned stackSlot = listCount - curArgTabEntry->numRegs;
- sprintf_s(bufp, bufLength, "arg%d m%d out+%02x%c", argNum, listCount,
- stackSlot * TARGET_POINTER_SIZE, 0);
+ unsigned lastRegNum = genMapIntRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
+ lastReg = genMapIntRegArgNumToRegNum(lastRegNum);
}
+ sprintf_s(bufp, bufLength, "arg%d %s%c%s out+%02x%c", argNum, compRegVarName(firstReg), separator,
+ compRegVarName(lastReg), (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
}
return;
}
#if FEATURE_MULTIREG_ARGS
if (curArgTabEntry->numRegs >= 2)
{
- // listCount could be -1 but it is signed, so this comparison is OK.
- assert(listCount <= MAX_ARG_REG_COUNT);
char separator = (curArgTabEntry->numRegs == 2) ? ',' : '-';
sprintf_s(bufp, bufLength, "arg%d %s%c%s%c", curArgTabEntry->argNum, compRegVarName(argReg), separator,
compRegVarName(curArgTabEntry->GetRegNum(curArgTabEntry->numRegs - 1)), 0);
if (!argNode->IsNothingNode() && !argNode->IsArgPlaceHolderNode())
{
char buf[256];
- gtGetArgMsg(call, argNode, argnum, -1, buf, sizeof(buf));
+ gtGetArgMsg(call, argNode, argnum, buf, sizeof(buf));
gtDispChild(argNode, indentStack, (argNode == lastArgNode) ? IIArcBottom : IIArc, buf, false);
}
argnum++;
{
fgArgTabEntry* curArgTabEntry = gtArgEntryByNode(call, operand);
assert(curArgTabEntry);
+ assert(operand->OperGet() != GT_LIST);
- if (operand->OperGet() == GT_LIST)
+ if (!curArgTabEntry->isLateArg())
{
- int listIndex = 0;
- for (GenTreeArgList* element = operand->AsArgList(); element != nullptr; element = element->Rest())
- {
- operand = element->Current();
- if (curArgTabEntry->GetLateArgInx() == (unsigned)-1)
- {
- gtGetArgMsg(call, operand, curArgTabEntry->argNum, listIndex, buf, sizeof(buf));
- }
- else
- {
- gtGetLateArgMsg(call, operand, curArgTabEntry->GetLateArgInx(), listIndex, buf,
- sizeof(buf));
- }
-
- displayOperand(operand, buf, operandArc, indentStack, prefixIndent);
- operandArc = IIArc;
- }
+ gtGetArgMsg(call, operand, curArgTabEntry->argNum, buf, sizeof(buf));
}
else
{
- if (!curArgTabEntry->isLateArg())
- {
- gtGetArgMsg(call, operand, curArgTabEntry->argNum, -1, buf, sizeof(buf));
- }
- else
- {
- gtGetLateArgMsg(call, operand, curArgTabEntry->GetLateArgInx(), -1, buf, sizeof(buf));
- }
-
- displayOperand(operand, buf, operandArc, indentStack, prefixIndent);
+ gtGetLateArgMsg(call, operand, curArgTabEntry->GetLateArgInx(), buf, sizeof(buf));
}
+
+ displayOperand(operand, buf, operandArc, indentStack, prefixIndent);
}
}
else if (node->OperIsDynBlkOp())