Skip to content

Commit

Permalink
Allow instrumentation for methods with explicit tail calls (#58632)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored Sep 6, 2021
1 parent dff1c70 commit 32df679
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/coreclr/jit/fgbasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2722,9 +2722,12 @@ unsigned Compiler::fgMakeBasicBlocks(const BYTE* codeAddr, IL_OFFSET codeSize, F
if (fgCanSwitchToOptimized() && fgMayExplicitTailCall())
{
// Method has an explicit tail call that may run like a loop or may not be generated as a tail
// call in tier 0, switch to optimized to avoid spending too much time running slower code and
// to avoid stack overflow from recursion
fgSwitchToOptimized();
// call in tier 0, switch to optimized to avoid spending too much time running slower code
if (!opts.jitFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR) ||
((info.compFlags & CORINFO_FLG_DISABLE_TIER0_FOR_LOOPS) != 0))
{
fgSwitchToOptimized();
}
}
}
else
Expand Down

0 comments on commit 32df679

Please sign in to comment.