Skip to content

Commit

Permalink
Rename rsMaskVars (dotnet#27012)
Browse files Browse the repository at this point in the history
* find src/jit -type f -exec sed -i -e 's/rsMaskVars->/GetMaskVars()->/g' {} \;

* Remove dangling comment

* Format patch

* Move to next line

* Update regset.h

* delete the comment after `public:`.

We have found them useless in the past and here it corrupts the formatting.
  • Loading branch information
franksinankaya authored and Sergey Andreenko committed Oct 4, 2019
1 parent 82ed48c commit 9d92b3b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ regMaskTP CodeGenInterface::genGetRegMask(GenTree* tree)

// The given lclVar is either going live (being born) or dying.
// It might be both going live and dying (that is, it is a dead store) under MinOpts.
// Update regSet.rsMaskVars accordingly.
// Update regSet.GetMaskVars() accordingly.
// inline
void CodeGenInterface::genUpdateRegLife(const LclVarDsc* varDsc, bool isBorn, bool isDying DEBUGARG(GenTree* tree))
{
Expand All @@ -499,12 +499,12 @@ void CodeGenInterface::genUpdateRegLife(const LclVarDsc* varDsc, bool isBorn, bo
{
// We'd like to be able to assert the following, however if we are walking
// through a qmark/colon tree, we may encounter multiple last-use nodes.
// assert((regSet.rsMaskVars & regMask) == regMask);
// assert((regSet.GetMaskVars() & regMask) == regMask);
regSet.RemoveMaskVars(regMask);
}
else
{
assert((regSet.rsMaskVars & regMask) == 0);
assert((regSet.GetMaskVars() & regMask) == 0);
regSet.AddMaskVars(regMask);
}
}
Expand Down
18 changes: 9 additions & 9 deletions src/jit/codegenlinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void CodeGen::genCodeForBBlist()
}
}

regSet.rsMaskVars = newLiveRegSet;
regSet.SetMaskVars(newLiveRegSet);

#ifdef DEBUG
if (compiler->verbose)
Expand Down Expand Up @@ -474,7 +474,7 @@ void CodeGen::genCodeForBBlist()
/* Make sure we didn't bungle pointer register tracking */

regMaskTP ptrRegs = gcInfo.gcRegGCrefSetCur | gcInfo.gcRegByrefSetCur;
regMaskTP nonVarPtrRegs = ptrRegs & ~regSet.rsMaskVars;
regMaskTP nonVarPtrRegs = ptrRegs & ~regSet.GetMaskVars();

// If return is a GC-type, clear it. Note that if a common
// epilog is generated (genReturnBB) it has a void return
Expand All @@ -492,14 +492,14 @@ void CodeGen::genCodeForBBlist()
if (nonVarPtrRegs)
{
printf("Regset after " FMT_BB " gcr=", block->bbNum);
printRegMaskInt(gcInfo.gcRegGCrefSetCur & ~regSet.rsMaskVars);
compiler->GetEmitter()->emitDispRegSet(gcInfo.gcRegGCrefSetCur & ~regSet.rsMaskVars);
printRegMaskInt(gcInfo.gcRegGCrefSetCur & ~regSet.GetMaskVars());
compiler->GetEmitter()->emitDispRegSet(gcInfo.gcRegGCrefSetCur & ~regSet.GetMaskVars());
printf(", byr=");
printRegMaskInt(gcInfo.gcRegByrefSetCur & ~regSet.rsMaskVars);
compiler->GetEmitter()->emitDispRegSet(gcInfo.gcRegByrefSetCur & ~regSet.rsMaskVars);
printRegMaskInt(gcInfo.gcRegByrefSetCur & ~regSet.GetMaskVars());
compiler->GetEmitter()->emitDispRegSet(gcInfo.gcRegByrefSetCur & ~regSet.GetMaskVars());
printf(", regVars=");
printRegMaskInt(regSet.rsMaskVars);
compiler->GetEmitter()->emitDispRegSet(regSet.rsMaskVars);
printRegMaskInt(regSet.GetMaskVars());
compiler->GetEmitter()->emitDispRegSet(regSet.GetMaskVars());
printf("\n");
}

Expand Down Expand Up @@ -1004,7 +1004,7 @@ void CodeGen::genUnspillRegIfNeeded(GenTree* tree)
// TODO-Review: We would like to call:
// genUpdateRegLife(varDsc, /*isBorn*/ true, /*isDying*/ false DEBUGARG(tree));
// instead of the following code, but this ends up hitting this assert:
// assert((regSet.rsMaskVars & regMask) == 0);
// assert((regSet.GetMaskVars() & regMask) == 0);
// due to issues with LSRA resolution moves.
// So, just force it for now. This probably indicates a condition that creates a GC hole!
//
Expand Down
6 changes: 3 additions & 3 deletions src/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6067,15 +6067,15 @@ void CodeGen::genJmpMethod(GenTree* jmp)
if (type0 != TYP_UNKNOWN)
{
GetEmitter()->emitIns_R_S(ins_Load(type0), emitTypeSize(type0), varDsc->lvArgReg, varNum, offset0);
regSet.rsMaskVars |= genRegMask(varDsc->lvArgReg);
regSet.SetMaskVars(regSet.GetMaskVars() | genRegMask(varDsc->lvArgReg));
gcInfo.gcMarkRegPtrVal(varDsc->lvArgReg, type0);
}

if (type1 != TYP_UNKNOWN)
{
GetEmitter()->emitIns_R_S(ins_Load(type1), emitTypeSize(type1), varDsc->GetOtherArgReg(), varNum,
offset1);
regSet.rsMaskVars |= genRegMask(varDsc->GetOtherArgReg());
regSet.SetMaskVars(regSet.GetMaskVars() | genRegMask(varDsc->GetOtherArgReg()));
gcInfo.gcMarkRegPtrVal(varDsc->GetOtherArgReg(), type1);
}

Expand Down Expand Up @@ -8604,7 +8604,7 @@ void CodeGen::genEmitHelperCall(unsigned helper, int argSize, emitAttr retSize,
// The call target must not overwrite any live variable, though it may not be in the
// kill set for the call.
regMaskTP callTargetMask = genRegMask(callTargetReg);
noway_assert((callTargetMask & regSet.rsMaskVars) == RBM_NONE);
noway_assert((callTargetMask & regSet.GetMaskVars()) == RBM_NONE);
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/jit/gcinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ void GCInfo::gcMarkRegSetNpt(regMaskTP regMask DEBUGARG(bool forceOutput))
{
/* NOTE: don't unmark any live register variables */

regMaskTP gcRegByrefSetNew = gcRegByrefSetCur & ~(regMask & ~regSet->rsMaskVars);
regMaskTP gcRegGCrefSetNew = gcRegGCrefSetCur & ~(regMask & ~regSet->rsMaskVars);
regMaskTP gcRegByrefSetNew = gcRegByrefSetCur & ~(regMask & ~regSet->GetMaskVars());
regMaskTP gcRegGCrefSetNew = gcRegGCrefSetCur & ~(regMask & ~regSet->GetMaskVars());

INDEBUG(gcDspGCrefSetChanges(gcRegGCrefSetNew, forceOutput));
INDEBUG(gcDspByrefSetChanges(gcRegByrefSetNew, forceOutput));
Expand Down
5 changes: 1 addition & 4 deletions src/jit/regset.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ class RegSet

void verifyRegistersUsed(regMaskTP regMask);

public: // TODO-Cleanup: Should be private, but GCInfo uses them
__declspec(property(get = GetMaskVars, put = SetMaskVars)) regMaskTP rsMaskVars; // mask of registers currently
// allocated to variables

public:
regMaskTP GetMaskVars() const // 'get' property function for rsMaskVars property
{
return _rsMaskVars;
Expand Down

0 comments on commit 9d92b3b

Please sign in to comment.