Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Switch to operator->, use CMK_DebugOnly for allocations
  • Loading branch information
jakobbotsch committed Nov 19, 2021
commit eb3760351def274743a75efe38d99a2a14992388
22 changes: 9 additions & 13 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10616,9 +10616,7 @@ void CodeGen::genIPmappingGen()
for (jitstd::list<IPmappingDsc>::iterator it = compiler->genIPmappings.begin();
it != compiler->genIPmappings.end();)
{
const IPmappingDsc& dsc = *it;

UNATIVE_OFFSET dscNativeOfs = dsc.ipmdNativeLoc.CodeOffset(GetEmitter());
UNATIVE_OFFSET dscNativeOfs = it->ipmdNativeLoc.CodeOffset(GetEmitter());
if (dscNativeOfs != prevNativeOfs)
{
prevNativeOfs = dscNativeOfs;
Expand All @@ -10631,18 +10629,16 @@ void CodeGen::genIPmappingGen()
jitstd::list<IPmappingDsc>::iterator prev = it;
--prev;

const IPmappingDsc& prevDsc = *prev;

// Prev and current mappings have same native offset.
// If one does not map to IL then remove that one.
if (prevDsc.ipmdKind == IPmappingDscKind::NoMapping)
if (prev->ipmdKind == IPmappingDscKind::NoMapping)
{
compiler->genIPmappings.erase(prev);
++it;
continue;
}

if (dsc.ipmdKind == IPmappingDscKind::NoMapping)
if (it->ipmdKind == IPmappingDscKind::NoMapping)
{
it = compiler->genIPmappings.erase(it);
continue;
Expand All @@ -10652,8 +10648,8 @@ void CodeGen::genIPmappingGen()
// If previous is the prolog, keep both if this one is at IL offset 0.
// (TODO: Why? Debugger has no problem breaking on the prolog mapping
// it seems.)
if ((prevDsc.ipmdKind == IPmappingDscKind::Prolog) && (dsc.ipmdKind == IPmappingDscKind::Normal) &&
(dsc.ipmdLoc.GetOffset() == 0))
if ((prev->ipmdKind == IPmappingDscKind::Prolog) && (it->ipmdKind == IPmappingDscKind::Normal) &&
(it->ipmdLoc.GetOffset() == 0))
{
++it;
continue;
Expand All @@ -10665,24 +10661,24 @@ void CodeGen::genIPmappingGen()
// statement if the user tries to put a breakpoint there, and then have
// the option of seeing the epilog or not based on SetUnmappedStopMask
// for the stepper.
if (dsc.ipmdKind == IPmappingDscKind::Epilog)
if (it->ipmdKind == IPmappingDscKind::Epilog)
{
++it;
continue;
}

// For managed return values we store all calls. Keep both in this case
// too.
if (((prevDsc.ipmdKind == IPmappingDscKind::Normal) && (prevDsc.ipmdLoc.IsCall())) ||
((dsc.ipmdKind == IPmappingDscKind::Normal) && (dsc.ipmdLoc.IsCall())))
if (((prev->ipmdKind == IPmappingDscKind::Normal) && (prev->ipmdLoc.IsCall())) ||
((it->ipmdKind == IPmappingDscKind::Normal) && (it->ipmdLoc.IsCall())))
{
++it;
continue;
}

// Otherwise report the higher offset unless the previous mapping is a
// label.
if (prevDsc.ipmdIsLabel)
if (prev->ipmdIsLabel)
{
it = compiler->genIPmappings.erase(it);
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,7 @@ void Compiler::compInit(ArenaAllocator* pAlloc,

new (&genIPmappings, jitstd::placement_t()) jitstd::list<IPmappingDsc>(getAllocator(CMK_DebugInfo));
#ifdef DEBUG
new (&genPreciseIPmappings, jitstd::placement_t()) jitstd::list<PreciseIPMapping>(getAllocator(CMK_DebugInfo));
new (&genPreciseIPmappings, jitstd::placement_t()) jitstd::list<PreciseIPMapping>(getAllocator(CMK_DebugOnly));
#endif

lvMemoryPerSsaData = SsaDefArray<SsaMemDef>();
Expand Down