未验证 提交 6a8a583d 编写于 作者: B Bruce Forstall 提交者: GitHub

Handle zero-sized unwind fragment candidates (#62931)

Every unwind fragment should be non-zero sized. If we consider
splitting on a boundary that would create a zero-sized fragment,
don't report that one. This only occurs when setting the
stress mode JitSplitFunctionSize to something small.
上级 562d1e7f
......@@ -2738,13 +2738,29 @@ void emitter::emitSplit(emitLocation* startLoc,
reportCandidate = false;
}
// Don't report a zero-size candidate. This will only occur in a stress mode with JitSplitFunctionSize
// set to something small, and a zero-sized IG (possibly inserted for use by the alignment code). Normally,
// the split size will be much larger than the maximum size of an instruction group. The invariant we want
// to maintain is that each fragment contains a non-zero amount of code.
if (reportCandidate && (candidateSize == 0))
{
#ifdef DEBUG
if (EMITVERBOSE)
printf("emitSplit: can't split at IG%02u; zero-sized candidate\n", igLastCandidate->igNum);
#endif
reportCandidate = false;
}
// Report it!
if (reportCandidate)
{
#ifdef DEBUG
if (EMITVERBOSE && (candidateSize >= maxSplitSize))
printf("emitSplit: split at IG%02u is size %d, larger than requested maximum size of %d\n",
igLastCandidate->igNum, candidateSize, maxSplitSize);
if (EMITVERBOSE)
{
printf("emitSplit: split at IG%02u is size %d, %s than requested maximum size of %d\n",
igLastCandidate->igNum, candidateSize, (candidateSize >= maxSplitSize) ? "larger" : "less",
maxSplitSize);
}
#endif
// hand memory ownership to the callback function
......
......@@ -1693,7 +1693,12 @@ void UnwindFragmentInfo::Dump(int indent)
printf("%*sUnwindFragmentInfo #%d, @0x%08p, size:%d:\n", indent, "", ufiNum, dspPtr(this), sizeof(*this));
printf("%*s uwiComp: 0x%08p\n", indent, "", dspPtr(uwiComp));
printf("%*s ufiNext: 0x%08p\n", indent, "", dspPtr(ufiNext));
printf("%*s ufiEmitLoc: 0x%08p\n", indent, "", dspPtr(ufiEmitLoc));
printf("%*s ufiEmitLoc: 0x%08p ", indent, "", dspPtr(ufiEmitLoc));
if (ufiEmitLoc != nullptr)
{
ufiEmitLoc->Print(uwiComp->compMethodID);
}
printf("\n");
printf("%*s ufiHasPhantomProlog: %s\n", indent, "", dspBool(ufiHasPhantomProlog));
printf("%*s %d epilog%s\n", indent, "", count, (count != 1) ? "s" : "");
printf("%*s ufiEpilogList: 0x%08p\n", indent, "", dspPtr(ufiEpilogList));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册