Bug 1403220 - De-optimize some font functions to work around an MSVC PGO crash. r+a=RyanVM

This commit is contained in:
David Major 2017-09-27 10:17:00 -04:00
parent a3b6b15cef
commit cb46df4d86
2 changed files with 14 additions and 0 deletions

View File

@ -4485,6 +4485,10 @@ nsLayoutUtils::ComputeObjectDestRect(const nsRect& aConstraintRect,
return nsRect(imageTopLeftPt, concreteObjectSize);
}
// Bug 1403220: Suspected MSVC PGO miscompilation
#ifdef _MSC_VER
#pragma optimize("", off)
#endif
already_AddRefed<nsFontMetrics>
nsLayoutUtils::GetFontMetricsForFrame(const nsIFrame* aFrame, float aInflation)
{
@ -4504,6 +4508,9 @@ nsLayoutUtils::GetFontMetricsForFrame(const nsIFrame* aFrame, float aInflation)
}
return GetFontMetricsForStyleContext(styleContext, aInflation, variantWidth);
}
#ifdef _MSC_VER
#pragma optimize("", on)
#endif
already_AddRefed<nsFontMetrics>
nsLayoutUtils::GetFontMetricsForStyleContext(nsStyleContext* aStyleContext,

View File

@ -2006,6 +2006,10 @@ BuildTextRunsScanner::GetNextBreakBeforeFrame(uint32_t* aIndex)
return static_cast<nsTextFrame*>(mLineBreakBeforeFrames.ElementAt(index));
}
// Bug 1403220: Suspected MSVC PGO miscompilation
#ifdef _MSC_VER
#pragma optimize("", off)
#endif
static gfxFontGroup*
GetFontGroupForFrame(const nsIFrame* aFrame, float aFontSizeInflation,
nsFontMetrics** aOutFontMetrics = nullptr)
@ -2024,6 +2028,9 @@ GetFontGroupForFrame(const nsIFrame* aFrame, float aFontSizeInflation,
// not actually happen. But we should fix this.
return fontGroup;
}
#ifdef _MSC_VER
#pragma optimize("", on)
#endif
static already_AddRefed<DrawTarget>
CreateReferenceDrawTarget(const nsTextFrame* aTextFrame)