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 183057 1150740733cbb14aa9f724b4673b2d9cf5c19387
parent 183056 4bc0ff092aca4bd4e8a165cf6ab0bbbb528f2e60
child 183058 53b26d3251dd4f439bac10808789d370ea3b88dd
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke, abillings
bugs977538
milestone29.0a2
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 }