未验证 提交 fdaaa61d 编写于 作者: B Brian Bohe 提交者: GitHub

Avoid reporting empty debug info ranges to the vm (#77289)

* Removing empty variable live ranges

The debugger is not using empty variable live ranges.
We are reporting them because they can get extended
later if the variable becomes alive in the immediately
next emitted instruction. If an empty live range is
not getting extended, which we can realize after
emitting all the code or creating a new live range
for the same variable, we can remove it.

* Extending variable live ranges in more cases

When the emitter moved to the next group but has not
emitted any instruction, and the variable died and
becomes alive again, we would like to extend its range.

* Avoiding creating a new debug range when previous is empty

* Updating check for empty debug ranges

* Updating print

* Avoiding printing twice variable live range

* Avoiding reporting empty variable ranges to the vm

* Revert "Avoiding printing twice variable live range"

This reverts commit 4e1cf47dd6cdf9d45ce4a51eaa05b3ec6e4b3b41.

* Revert "Updating print"

This reverts commit 7b79b0d955daa4dc9770b604d6780591b51c9ee1.

* Revert "Updating check for empty debug ranges"

This reverts commit e8b102d489d79028750068decf4f427ad8e5f69f.

* Revert "Avoiding creating a new debug range when previous is empty"

This reverts commit a11fd5d0ffaa98631d731bec1f2619f1d108d33a.

* Revert "Extending variable live ranges in more cases"

This reverts commit 609605a1ca7cf1c0c843dbaf353432ec9ed846e2.

* Revert "Removing empty variable live ranges"

This reverts commit 66d18e031f83c8efe864981b35c0548af49e0714.

* Freeing vm memory when there is no debug info

* Persisting JIT-EE contract on empty debug info

* Update src/coreclr/jit/ee_il_dll.cpp
Co-authored-by: NJakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Co-authored-by: NBrian Bohe <brianbohe@microsoft.com>
Co-authored-by: NJakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
上级 13d4e6de
......@@ -6952,8 +6952,11 @@ void CodeGen::genSetScopeInfoUsingVariableRanges()
end++;
}
genSetScopeInfo(liveRangeIndex, start, end - start, varNum, varNum, true, loc);
liveRangeIndex++;
if (start < end)
{
genSetScopeInfo(liveRangeIndex, start, end - start, varNum, varNum, true, loc);
liveRangeIndex++;
}
};
siVarLoc* curLoc = nullptr;
......
......@@ -693,9 +693,15 @@ void Compiler::eeSetLVdone()
eeDispVars(info.compMethodHnd, eeVarsCount, (ICorDebugInfo::NativeVarInfo*)eeVars);
}
#endif // DEBUG
if ((eeVarsCount == 0) && (eeVars != nullptr))
{
// We still call setVars with nullptr when eeVarsCount is 0 as part of the contract.
// We also need to free the nonused memory.
info.compCompHnd->freeArray(eeVars);
eeVars = nullptr;
}
info.compCompHnd->setVars(info.compMethodHnd, eeVarsCount, (ICorDebugInfo::NativeVarInfo*)eeVars);
eeVars = nullptr; // We give up ownership after setVars()
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册