Bug 1274450 - Disable PGO for nsTreeBodyFrame::PaintText. r=sfink a=KWierso
MozReview-Commit-ID: GL7gz3vuvAD
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -3664,16 +3664,23 @@ nsTreeBodyFrame::PaintImage(int32_t
aRemainingWidth -= imageRect.width;
if (!isRTL) {
aCurrX += imageRect.width;
}
return result;
}
+// Disable PGO for PaintText because MSVC 2015 seems to have decided
+// that it can null out the alreadyAddRefed<nsFontMetrics> used to
+// initialize fontMet after storing fontMet on the stack in the same
+// space, overwriting fontMet's stack storage with null.
+#ifdef _MSC_VER
+# pragma optimize("g", off)
+#endif
DrawResult
nsTreeBodyFrame::PaintText(int32_t aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aTextRect,
nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nscoord& aCurrX)
@@ -3796,16 +3803,19 @@ nsTreeBodyFrame::PaintText(int32_t
cellContext);
if (opacity != 1.0f) {
ctx->PopGroupAndBlend();
}
return result;
}
+#ifdef _MSC_VER
+# pragma optimize("", on)
+#endif
DrawResult
nsTreeBodyFrame::PaintCheckbox(int32_t aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aCheckboxRect,
nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext,
const nsRect& aDirtyRect)