Bug 1274450 - Disable PGO for nsTreeBodyFrame::PaintText. r=sfink a=KWierso
authorL. David Baron <dbaron@dbaron.org>
Fri, 20 May 2016 14:46:02 -0700
changeset 369237 30b83fcb0009b524cf3982a8aeb2bc0fc6d2d5b7
parent 369236 44fa05b72b6fb2ef0edfe73e4767154ab99381bc
child 369238 21cd8e1a034e223c962167fd3f1e5434691cbbda
child 369239 7502d9ef870f1d86f5819177324cb623e741f0f3
child 369258 99a79ab2d7a73b710f72351a5b016d5c16857293
child 369313 45709b7b6466abcd984d5736c0e64eb12b0044cc
child 369681 952e152f4dd90fd79dfb93c2e28e0b11e6e37a07
push id18806
push userbmo:gps@mozilla.com
push dateFri, 20 May 2016 21:59:07 +0000
reviewerssfink, KWierso
bugs1274450
milestone49.0a1
Bug 1274450 - Disable PGO for nsTreeBodyFrame::PaintText. r=sfink a=KWierso MozReview-Commit-ID: GL7gz3vuvAD
layout/xul/tree/nsTreeBodyFrame.cpp
--- 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)