Skip to content

Commit

Permalink
Removing old variable debug info tracking system (#80537)
Browse files Browse the repository at this point in the history
* Removing ScopeInfo variable debug info

Variable live range replaced it on 2019.

* Removing VaribleLiveRange preprocessing flag

* Adding #if defined(DEBUG)

* Using ifdef in place of defined
  • Loading branch information
BrianBohe authored Jan 13, 2023
1 parent f97f5be commit 4140185
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 1,305 deletions.
197 changes: 13 additions & 184 deletions src/coreclr/jit/codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -696,38 +696,9 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
siVarLoc* varLoc);

void genSetScopeInfo();
#ifdef USING_VARIABLE_LIVE_RANGE
// Send VariableLiveRanges as debug info to the debugger
void genSetScopeInfoUsingVariableRanges();
#endif // USING_VARIABLE_LIVE_RANGE

#ifdef USING_SCOPE_INFO
void genSetScopeInfoUsingsiScope();

/*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XX XX
XX ScopeInfo XX
XX XX
XX Keeps track of the scopes during code-generation. XX
XX This is used to translate the local-variable debugging information XX
XX from IL offsets to native code offsets. XX
XX XX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
*/

/*****************************************************************************/
/*****************************************************************************
* ScopeInfo
*
* This class is called during code gen at block-boundaries, and when the
* set of live variables changes. It keeps track of the scope of the variables
* in terms of the native code PC.
*/

#endif // USING_SCOPE_INFO
public:
void siInit();
void checkICodeDebugInfo();
Expand All @@ -747,166 +718,24 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IL_OFFSET siLastEndOffs; // IL offset of the (exclusive) end of the last block processed

#ifdef USING_SCOPE_INFO

public:
// Closes the "ScopeInfo" of the tracked variables that has become dead.
virtual void siUpdate();

void siCheckVarScope(unsigned varNum, IL_OFFSET offs);

void siCloseAllOpenScopes();

#ifdef DEBUG
void siDispOpenScopes();
#endif

/**************************************************************************
* PROTECTED
*************************************************************************/

protected:
struct siScope
{
emitLocation scStartLoc; // emitter location of start of scope
emitLocation scEndLoc; // emitter location of end of scope

unsigned scVarNum; // index into lvaTable
unsigned scLVnum; // 'which' in eeGetLVinfo()

unsigned scStackLevel; // Only for stk-vars

siScope* scPrev;
siScope* scNext;
};

// Returns a "siVarLoc" instance representing the place where the variable lives base on
// varDsc and scope description.
CodeGenInterface::siVarLoc getSiVarLoc(const LclVarDsc* varDsc, const siScope* scope) const;

siScope siOpenScopeList, siScopeList, *siOpenScopeLast, *siScopeLast;

unsigned siScopeCnt;

VARSET_TP siLastLife; // Life at last call to siUpdate()

// Tracks the last entry for each tracked register variable

siScope** siLatestTrackedScopes;

// Functions

siScope* siNewScope(unsigned LVnum, unsigned varNum);

void siRemoveFromOpenScopeList(siScope* scope);

void siEndTrackedScope(unsigned varIndex);

void siEndScope(unsigned varNum);

void siEndScope(siScope* scope);

#ifdef DEBUG
bool siVerifyLocalVarTab();
#endif

#ifdef LATE_DISASM
public:
/* virtual */
const char* siRegVarName(size_t offs, size_t size, unsigned reg);

/* virtual */
const char* siStackVarName(size_t offs, size_t size, unsigned reg, unsigned stkOffs);
#endif // LATE_DISASM

/*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XX XX
XX PrologScopeInfo XX
XX XX
XX We need special handling in the prolog block, as the parameter variables XX
XX may not be in the same position described by genLclVarTable - they all XX
XX start out on the stack XX
XX XX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
*/
#endif // USING_SCOPE_INFO
/*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XX XX
XX PrologScopeInfo XX
XX XX
XX We need special handling in the prolog block, as the parameter variables XX
XX may not be in the same position described by genLclVarTable - they all XX
XX start out on the stack XX
XX XX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
*/
public:
void psiBegProlog();

void psiEndProlog();

#ifdef USING_SCOPE_INFO
void psiAdjustStackLevel(unsigned size);

// For EBP-frames, the parameters are accessed via ESP on entry to the function,
// but via EBP right after a "mov ebp,esp" instruction.
void psiMoveESPtoEBP();

// Close previous psiScope and open a new one on the location described by the registers.
void psiMoveToReg(unsigned varNum, regNumber reg = REG_NA, regNumber otherReg = REG_NA);

// Search the open "psiScope" of the "varNum" parameter, close it and open
// a new one using "LclVarDsc" fields.
void psiMoveToStack(unsigned varNum);

/**************************************************************************
* PROTECTED
*************************************************************************/

protected:
struct psiScope
{
emitLocation scStartLoc; // emitter location of start of scope
emitLocation scEndLoc; // emitter location of end of scope

unsigned scSlotNum; // index into lclVarTab
unsigned scLVnum; // 'which' in eeGetLVinfo()

bool scRegister;

union {
struct
{
regNumberSmall scRegNum;

// Used for:
// - "other half" of long var on architectures with 32 bit size registers - x86.
// - for System V structs it stores the second register
// used to pass a register passed struct.
regNumberSmall scOtherReg;
} u1;

struct
{
regNumberSmall scBaseReg;
NATIVE_OFFSET scOffset;
} u2;
};

psiScope* scPrev;
psiScope* scNext;

// Returns a "siVarLoc" instance representing the place where the variable lives base on
// psiScope properties.
CodeGenInterface::siVarLoc getSiVarLoc() const;
};

psiScope psiOpenScopeList, psiScopeList, *psiOpenScopeLast, *psiScopeLast;

unsigned psiScopeCnt;

// Implementation Functions

psiScope* psiNewPrologScope(unsigned LVnum, unsigned slotNum);

void psiEndPrologScope(psiScope* scope);

void psiSetScopeOffset(psiScope* newScope, const LclVarDsc* lclVarDsc) const;
#endif // USING_SCOPE_INFO

NATIVE_OFFSET psiGetVarStackOffset(const LclVarDsc* lclVarDsc) const;

/*****************************************************************************
Expand Down
6 changes: 0 additions & 6 deletions src/coreclr/jit/codegenarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1898,12 +1898,6 @@ void CodeGen::genAllocLclFrame(unsigned frameSize, regNumber initReg, bool* pIni
}

compiler->unwindAllocStack(frameSize);
#ifdef USING_SCOPE_INFO
if (!doubleAlignOrFramePointerUsed())
{
psiAdjustStackLevel(frameSize);
}
#endif // USING_SCOPE_INFO
}

void CodeGen::genPushFltRegs(regMaskTP regMask)
Expand Down
Loading

0 comments on commit 4140185

Please sign in to comment.