Bug 977538 - Disable PGO for CanonicalizeNaN. r=luke, a=abillings
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 27 Feb 2014 20:48:59 +0100
changeset 176402 7bf309f95730dd092f84a61235eba45782d1d4d0
parent 176399 72efe9bb86a9a0f8a70befb122ea32b20133ab91
child 176403 a910892387e1defe4e2385e89814b6c23ffc71b1
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke, abillings
bugs977538
milestone28.0
Bug 977538 - Disable PGO for CanonicalizeNaN. r=luke, a=abillings
js/public/Value.h
--- a/js/public/Value.h
+++ b/js/public/Value.h
@@ -857,23 +857,30 @@ static inline JS_VALUE_CONSTEXPR JS::Val
  * bit pattern restrictions.
  */
 static MOZ_ALWAYS_INLINE double
 GenericNaN()
 {
   return mozilla::SpecificNaN(0, 0x8000000000000ULL);
 }
 
+/* MSVC with PGO miscompiles this function. */
+#if defined(_MSC_VER)
+# pragma optimize("g", off)
+#endif
 static inline double
 CanonicalizeNaN(double d)
 {
     if (MOZ_UNLIKELY(mozilla::IsNaN(d)))
         return GenericNaN();
     return d;
 }
+#if defined(_MSC_VER)
+# pragma optimize("", on)
+#endif
 
 /*
  * JS::Value is the interface for a single JavaScript Engine value.  A few
  * general notes on JS::Value:
  *
  * - JS::Value has setX() and isX() members for X in
  *
  *     { Int32, Double, String, Boolean, Undefined, Null, Object, Magic }