Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8730,7 +8730,7 @@ void CodeGenInterface::VariableLiveKeeper::VariableLiveDescriptor::startLiveRang

if (!m_VariableLiveRanges->empty() &&
siVarLoc::Equals(&varLocation, &(m_VariableLiveRanges->back().m_VarLocation)) &&
m_VariableLiveRanges->back().m_EndEmitLocation.IsPreviousInsNum(emit))
m_VariableLiveRanges->back().m_EndEmitLocation.IsLessOneInsAway(emit))
{
JITDUMP("Extending debug range...\n");

Expand Down
11 changes: 6 additions & 5 deletions src/coreclr/jit/emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,27 @@ UNATIVE_OFFSET emitLocation::GetFuncletPrologOffset(emitter* emit) const
}

//------------------------------------------------------------------------
// IsPreviousInsNum: Returns true if the emitter is on the next instruction
// of the same group as this emitLocation.
// IsLessOneInsAway: Returns true if the emitter is on the same or next
// emitted location. That means the same or next instruction at the same
// group as this emitLocation or at the beginning of the next group.
//
// Arguments:
// emit - an emitter* instance
//
bool emitLocation::IsPreviousInsNum(emitter* emit) const
bool emitLocation::IsLessOneInsAway(emitter* emit) const
{
assert(Valid());

// Within the same IG?
if (ig == emit->emitCurIG)
{
return (emitGetInsNumFromCodePos(codePos) == emitGetInsNumFromCodePos(emit->emitCurOffset()) - 1);
return emitGetInsNumFromCodePos(emit->emitCurOffset()) <= emitGetInsNumFromCodePos(codePos) + 1;
}

// Spanning an IG boundary?
if (ig->igNext == emit->emitCurIG)
{
return (emitGetInsNumFromCodePos(codePos) == ig->igInsCnt) && (emit->emitCurIGinsCnt == 1);
return (emitGetInsNumFromCodePos(codePos) == ig->igInsCnt) && (emit->emitCurIGinsCnt <= 1);
}

return false;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/emit.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class emitLocation

UNATIVE_OFFSET GetFuncletPrologOffset(emitter* emit) const;

bool IsPreviousInsNum(emitter* emit) const;
bool IsLessOneInsAway(emitter* emit) const;

#ifdef DEBUG
void Print(LONG compMethodID) const;
Expand Down