From 5a887ed890ad177e388ddf6d69ee051ce0400c70 Mon Sep 17 00:00:00 2001 From: Lubomir Litchev Date: Tue, 19 Jan 2016 22:05:53 -0800 Subject: [PATCH] One of the commits for resolving Issue 2380 failed. The changes are cosmetic and cleanup. Adding it as this separate commit. --- src/jit/codegenlinear.h | 1 - src/jit/codegenxarch.cpp | 13 ++++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/jit/codegenlinear.h b/src/jit/codegenlinear.h index 20381d5..14c79a5 100644 --- a/src/jit/codegenlinear.h +++ b/src/jit/codegenlinear.h @@ -43,7 +43,6 @@ unsigned getBaseVarForPutArgStk(GenTreePtr treeNode); #ifdef _TARGET_XARCH_ - // Defined for AMD64 System V targets only. unsigned getFirstArgWithStackSlot(); #endif // !_TARGET_XARCH_ diff --git a/src/jit/codegenxarch.cpp b/src/jit/codegenxarch.cpp index 56dbd71..aadce57 100644 --- a/src/jit/codegenxarch.cpp +++ b/src/jit/codegenxarch.cpp @@ -7947,7 +7947,7 @@ CodeGen::getFirstArgWithStackSlot() #else // Not implemented for x86. unreached(); - return 0; + return BAD_VAR_NUM; #endif // !FEATURE_UNIX_AMD64_STRUCT_PASSING } @@ -7961,11 +7961,11 @@ CodeGen::getFirstArgWithStackSlot() // The number of the base variable. // // Note: -// If tail call the outgoing args are placed in the callers outgoing stack space. -// Otherwise, they go in the outgoing area on the current frame. +// If tail call the outgoing args are placed in the caller's incoming arg stack space. +// Otherwise, they go in the outgoing arg area on the current frame. // // On Windows the caller always creates slots (homing space) in its frame for the -// first 4 arguments of a calee (register passed args). So, the baseVarNum is always 0. +// first 4 arguments of a callee (register passed args). So, the baseVarNum is always 0. // For System V systems there is no such calling convention requirement, and the code needs to find // the first stack passed argument from the caller. This is done by iterating over // all the lvParam variables and finding the first with lvArgReg equals to REG_STK. @@ -8001,12 +8001,11 @@ CodeGen::getBaseVarForPutArgStk(GenTreePtr treeNode) // arg area required for tail call. LclVarDsc* varDsc = &(compiler->lvaTable[baseVarNum]); assert(varDsc != nullptr); - // On Windows this assert is always true. The first argument will always be in REG_ARG_0 or REG_FLTARG_0. - // On System V systems the first arg will always be in the REG_ARG_0, REG_FLTARG_0 or on the stack (if it is a struct that - // is passed on the stack). + #ifdef FEATURE_UNIX_AMD64_STRUCT_PASSING assert(!varDsc->lvIsRegArg && varDsc->lvArgReg == REG_STK); #else // !FEATURE_UNIX_AMD64_STRUCT_PASSING + // On Windows this assert is always true. The first argument will always be in REG_ARG_0 or REG_FLTARG_0. assert(varDsc->lvIsRegArg && (varDsc->lvArgReg == REG_ARG_0 || varDsc->lvArgReg == REG_FLTARG_0)); #endif // !FEATURE_UNIX_AMD64_STRUCT_PASSING #endif // !DEBUG -- 2.7.4