summaryrefslogtreecommitdiff
path: root/src/jit/gentree.cpp
diff options
context:
space:
mode:
authorSergey Andreenko <seandree@microsoft.com>2019-04-25 14:59:33 -0700
committerSergey Andreenko <seandree@microsoft.com>2019-04-25 16:45:03 -0700
commit736291405ac4daf4fa84d11183e8be2bdf294425 (patch)
treeeb5492b593d9753eaded4c3dad8a8867e46087ab /src/jit/gentree.cpp
parentc0cae0a041549edd759366eb3e732f8348b466b3 (diff)
downloadcoreclr-736291405ac4daf4fa84d11183e8be2bdf294425.tar.gz
coreclr-736291405ac4daf4fa84d11183e8be2bdf294425.tar.bz2
coreclr-736291405ac4daf4fa84d11183e8be2bdf294425.zip
Add comments and format `gtGetThisArg`.
Diffstat (limited to 'src/jit/gentree.cpp')
-rw-r--r--src/jit/gentree.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp
index 9e58db0df4..5be016027f 100644
--- a/src/jit/gentree.cpp
+++ b/src/jit/gentree.cpp
@@ -7931,23 +7931,29 @@ bool Compiler::gtCompareTree(GenTree* op1, GenTree* op2)
GenTree* Compiler::gtGetThisArg(GenTreeCall* call)
{
- if (call->gtCallObjp != nullptr)
+ GenTree* thisArg = call->gtCallObjp;
+ if (thisArg != nullptr)
{
- if (call->gtCallObjp->gtOper != GT_NOP && call->gtCallObjp->gtOper != GT_ASG)
+ if (thisArg->OperIs(GT_NOP, GT_ASG) == false)
{
- if (!(call->gtCallObjp->gtFlags & GTF_LATE_ARG))
+ if ((thisArg->gtFlags & GTF_LATE_ARG) == 0)
{
return call->gtCallObjp;
}
}
- if (call->gtCallLateArgs)
+ if (call->gtCallLateArgs != nullptr)
{
unsigned argNum = 0;
fgArgTabEntry* thisArgTabEntry = gtArgEntryByArgNum(call, argNum);
GenTree* result = thisArgTabEntry->node;
#if !FEATURE_FIXED_OUT_ARGS && defined(DEBUG)
+ // Check that call->fgArgInfo used in gtArgEntryByArgNum was not
+ // left outdated by assertion propogation updates.
+ // There is no information about registers of late args for platforms
+ // with FEATURE_FIXED_OUT_ARGS that is why this debug check is under
+ // !FEATURE_FIXED_OUT_ARGS.
regNumber thisReg = REG_ARG_0;
GenTree* lateArgs = call->gtCallLateArgs;
regList list = call->regArgList;