Bug 1171904 - Remove --enable-js-crash-diagnostics and just use the NIGHTLY defines. r=sfink, a=ritu
authorTerrence Cole <terrence@mozilla.com>
Fri, 10 Jul 2015 10:50:19 -0700
changeset 281548 73587058aa473d3f0ed401367bbba67e97c983df
parent 281547 7ade4dc95c002b8b80f1e29a3abc24f384d2fd94
child 281549 414e93c84fe37711d907c1373e7fc2fefa608024
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink, ritu
bugs1171904
milestone41.0a2
Bug 1171904 - Remove --enable-js-crash-diagnostics and just use the NIGHTLY defines. r=sfink, a=ritu
b2g/config/mozconfigs/linux32_gecko/debug
b2g/config/mozconfigs/linux32_gecko/nightly
b2g/config/mozconfigs/linux64_gecko/debug
b2g/config/mozconfigs/linux64_gecko/nightly
b2g/config/mozconfigs/macosx64_gecko/debug
b2g/config/mozconfigs/macosx64_gecko/nightly
b2g/config/mozconfigs/win32_gecko/debug
b2g/config/mozconfigs/win32_gecko/nightly
b2g/dev/config/mozconfigs/macosx64/mulet
browser/config/mozconfigs/linux32/nightly
browser/config/mozconfigs/linux64/nightly
browser/config/mozconfigs/macosx-universal/nightly
browser/config/mozconfigs/whitelist
browser/config/mozconfigs/win32/nightly
browser/config/mozconfigs/win64/nightly
js/src/configure.in
js/src/jsutil.h
mobile/android/config/mozconfigs/android-api-11/l10n-nightly
mobile/android/config/mozconfigs/android-api-9-10-constrained/l10n-nightly
mobile/android/config/mozconfigs/android-x86/l10n-nightly
--- a/b2g/config/mozconfigs/linux32_gecko/debug
+++ b/b2g/config/mozconfigs/linux32_gecko/debug
@@ -4,19 +4,16 @@ MOZ_AUTOMATION_UPDATE_PACKAGING=0
 . "$topsrcdir/b2g/config/mozconfigs/common"
 . "$topsrcdir/build/unix/mozconfig.linux32"
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-signmar
 ac_add_options --enable-debug
 
-# Nightlies only since this has a cost in performance
-#ac_add_options --enable-js-diagnostics
-
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
 STRIP_FLAGS="--strip-debug"
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
--- a/b2g/config/mozconfigs/linux32_gecko/nightly
+++ b/b2g/config/mozconfigs/linux32_gecko/nightly
@@ -4,19 +4,16 @@ MOZ_AUTOMATION_UPDATE_PACKAGING=0
 MOZ_AUTOMATION_SDK=0
 . "$topsrcdir/b2g/config/mozconfigs/common"
 . "$topsrcdir/build/unix/mozconfig.linux32"
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-signmar
 
-# Nightlies only since this has a cost in performance
-#ac_add_options --enable-js-diagnostics
-
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
 STRIP_FLAGS="--strip-debug"
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
--- a/b2g/config/mozconfigs/linux64_gecko/debug
+++ b/b2g/config/mozconfigs/linux64_gecko/debug
@@ -4,19 +4,16 @@ MOZ_AUTOMATION_UPDATE_PACKAGING=0
 . "$topsrcdir/b2g/config/mozconfigs/common"
 . "$topsrcdir/build/unix/mozconfig.linux"
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-signmar
 ac_add_options --enable-debug
 
-# Nightlies only since this has a cost in performance
-#ac_add_options --enable-js-diagnostics
-
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
 STRIP_FLAGS="--strip-debug"
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
--- a/b2g/config/mozconfigs/linux64_gecko/nightly
+++ b/b2g/config/mozconfigs/linux64_gecko/nightly
@@ -4,19 +4,16 @@ MOZ_AUTOMATION_UPDATE_PACKAGING=0
 MOZ_AUTOMATION_SDK=0
 . "$topsrcdir/b2g/config/mozconfigs/common"
 . "$topsrcdir/build/unix/mozconfig.linux"
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-signmar
 
-# Nightlies only since this has a cost in performance
-#ac_add_options --enable-js-diagnostics
-
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
 STRIP_FLAGS="--strip-debug"
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
--- a/b2g/config/mozconfigs/macosx64_gecko/debug
+++ b/b2g/config/mozconfigs/macosx64_gecko/debug
@@ -6,19 +6,16 @@ MOZ_AUTOMATION_UPDATE_PACKAGING=0
 no_sccache=
 
 . $topsrcdir/build/macosx/mozconfig.common
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-signmar
 
-# Nightlies only since this has a cost in performance
-ac_add_options --enable-js-diagnostics
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
 #ac_add_options --with-macbundlename-prefix=Firefox
 
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
--- a/b2g/config/mozconfigs/macosx64_gecko/nightly
+++ b/b2g/config/mozconfigs/macosx64_gecko/nightly
@@ -7,19 +7,16 @@ MOZ_AUTOMATION_SDK=0
 no_sccache=
 
 . $topsrcdir/build/macosx/mozconfig.common
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-signmar
 
-# Nightlies only since this has a cost in performance
-ac_add_options --enable-js-diagnostics
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
 #ac_add_options --with-macbundlename-prefix=Firefox
 
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
--- a/b2g/config/mozconfigs/win32_gecko/debug
+++ b/b2g/config/mozconfigs/win32_gecko/debug
@@ -4,19 +4,16 @@ MOZ_AUTOMATION_UPDATE_PACKAGING=0
 . "$topsrcdir/b2g/config/mozconfigs/common"
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-jemalloc
 ac_add_options --enable-signmar
 ac_add_options --enable-debug
 
-# Nightlies only since this has a cost in performance
-ac_add_options --enable-js-diagnostics
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
 if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then
   . $topsrcdir/build/win32/mozconfig.vs2013-win64
 else
--- a/b2g/config/mozconfigs/win32_gecko/nightly
+++ b/b2g/config/mozconfigs/win32_gecko/nightly
@@ -4,19 +4,16 @@ MOZ_AUTOMATION_UPDATE_PACKAGING=0
 MOZ_AUTOMATION_SDK=0
 . "$topsrcdir/b2g/config/mozconfigs/common"
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-jemalloc
 ac_add_options --enable-signmar
 
-# Nightlies only since this has a cost in performance
-ac_add_options --enable-js-diagnostics
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
 if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then
   . $topsrcdir/build/win32/mozconfig.vs2013-win64
 else
--- a/b2g/dev/config/mozconfigs/macosx64/mulet
+++ b/b2g/dev/config/mozconfigs/macosx64/mulet
@@ -7,19 +7,16 @@ MOZ_AUTOMATION_SDK=0
 
 ac_add_options --enable-application=b2g/dev
 ac_add_options --disable-install-strip
 ac_add_options --enable-signmar
 ac_add_options --enable-profiling
 ac_add_options --enable-instruments
 ac_add_options --enable-dtrace
 
-# Nightlies only since this has a cost in performance
-ac_add_options --enable-js-diagnostics
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 ac_add_options --with-macbundlename-prefix=Firefox
 
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
 ac_add_options --enable-warnings-as-errors
 
--- a/browser/config/mozconfigs/linux32/nightly
+++ b/browser/config/mozconfigs/linux32/nightly
@@ -1,16 +1,13 @@
 . "$topsrcdir/browser/config/mozconfigs/linux32/common-opt"
 
 ac_add_options --enable-signmar
 
 
-# Nightlies only since this has a cost in performance
-ac_add_options --enable-js-diagnostics
-
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
 STRIP_FLAGS="--strip-debug"
 
 ac_add_options --with-branding=browser/branding/aurora
 
 # Use ccache
--- a/browser/config/mozconfigs/linux64/nightly
+++ b/browser/config/mozconfigs/linux64/nightly
@@ -1,16 +1,13 @@
 . "$topsrcdir/browser/config/mozconfigs/linux64/common-opt"
 
 ac_add_options --enable-signmar
 
 
-# Nightlies only since this has a cost in performance
-ac_add_options --enable-js-diagnostics
-
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
 STRIP_FLAGS="--strip-debug"
 
 ac_add_options --with-branding=browser/branding/aurora
 
 # Use ccache
--- a/browser/config/mozconfigs/macosx-universal/nightly
+++ b/browser/config/mozconfigs/macosx-universal/nightly
@@ -1,18 +1,15 @@
 . "$topsrcdir/browser/config/mozconfigs/macosx-universal/common-opt"
 
 ac_add_options --disable-install-strip
 ac_add_options --enable-signmar
 
 ac_add_options --enable-instruments
 ac_add_options --enable-dtrace
 
-# Nightlies only since this has a cost in performance
-ac_add_options --enable-js-diagnostics
-
 if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then
 ac_add_options --with-macbundlename-prefix=Firefox
 fi
 
 ac_add_options --with-branding=browser/branding/aurora
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/whitelist
+++ b/browser/config/mozconfigs/whitelist
@@ -17,17 +17,16 @@ for platform in all_platforms:
 
 for platform in ['linux32', 'linux64', 'macosx-universal']:
     whitelist['nightly'][platform] += [
         'mk_add_options MOZ_MAKE_FLAGS="-j4"',
     ]
 
 for platform in ['linux32', 'linux64', 'macosx-universal', 'win32', 'win64']:
     whitelist['nightly'][platform] += ['ac_add_options --enable-signmar']
-    whitelist['nightly'][platform] += ['ac_add_options --enable-js-diagnostics']
 
 whitelist['nightly']['linux32'] += [
     'CXX=$REAL_CXX',
     'CXX="ccache $REAL_CXX"',
     'CC="ccache $REAL_CC"',
     'mk_add_options PROFILE_GEN_SCRIPT=@TOPSRCDIR@/build/profile_pageloader.pl',
     'ac_add_options --with-ccache=/usr/bin/ccache',
     '. "$topsrcdir/build/mozconfig.cache"',
--- a/browser/config/mozconfigs/win32/nightly
+++ b/browser/config/mozconfigs/win32/nightly
@@ -1,14 +1,11 @@
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/win32/common-opt"
 
 ac_add_options --enable-signmar
 
 
-# Nightlies only since this has a cost in performance
-ac_add_options --enable-js-diagnostics
-
 ac_add_options --with-branding=browser/branding/aurora
 
 . "$topsrcdir/build/mozconfig.cache"
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/win64/nightly
+++ b/browser/config/mozconfigs/win64/nightly
@@ -1,15 +1,12 @@
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/win64/common-win64"
 . "$topsrcdir/browser/config/mozconfigs/win64/common-opt"
 
 ac_add_options --enable-signmar
 
 
-# Nightlies only since this has a cost in performance
-ac_add_options --enable-js-diagnostics
-
 ac_add_options --with-branding=browser/branding/aurora
 
 . "$topsrcdir/build/mozconfig.cache"
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -3307,28 +3307,16 @@ MOZ_ARG_ENABLE_BOOL(perf,
 [  --enable-perf           Enable Linux perf integration],
   JS_ION_PERF=1,
   JS_ION_PERF= )
 if test -n "$JS_ION_PERF"; then
     AC_DEFINE(JS_ION_PERF)
 fi
 
 dnl ========================================================
-dnl JS opt-mode assertions and heap poisoning
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(js-diagnostics,
-[  --enable-js-diagnostics
-                          Enable JS diagnostic assertions heap poisoning],
-    JS_CRASH_DIAGNOSTICS=1,
-    JS_CRASH_DIAGNOSTICS= )
-if test -n "$JS_CRASH_DIAGNOSTICS"; then
-    AC_DEFINE(JS_CRASH_DIAGNOSTICS)
-fi
-
-dnl ========================================================
 dnl Enable changes that make the shell more deterministic
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(more-deterministic,
 [  --enable-more-deterministic
                           Enable changes that make the shell more deterministic],
     JS_MORE_DETERMINISTIC=1,
     JS_MORE_DETERMINISTIC= )
 if test -n "$JS_MORE_DETERMINISTIC"; then
--- a/js/src/jsutil.h
+++ b/js/src/jsutil.h
@@ -292,54 +292,65 @@ PodSet(T* aDst, T aSrc, size_t aNElem)
         *aDst = aSrc;
 }
 
 } /* namespace mozilla */
 
 static inline void*
 Poison(void* ptr, uint8_t value, size_t num)
 {
-    static bool poison = !bool(getenv("JSGC_DISABLE_POISONING"));
-    if (poison) {
-        // Without a valid Value tag, a poisoned Value may look like a valid
-        // floating point number. To ensure that we crash more readily when
-        // observing a poised Value, we make the poison an invalid ObjectValue.
-        uintptr_t obj;
-        memset(&obj, value, sizeof(obj));
-#if defined(JS_PUNBOX64)
-        obj = obj & ((uintptr_t(1) << JSVAL_TAG_SHIFT) - 1);
-#endif
-        const jsval_layout layout = OBJECT_TO_JSVAL_IMPL((JSObject*)obj);
+    static bool disablePoison = bool(getenv("JSGC_DISABLE_POISONING"));
+    if (disablePoison)
+        return ptr;
 
-        size_t value_count = num / sizeof(jsval_layout);
-        size_t byte_count = num % sizeof(jsval_layout);
-        mozilla::PodSet((jsval_layout*)ptr, layout, value_count);
-        if (byte_count) {
-            uint8_t* bytes = static_cast<uint8_t*>(ptr);
-            uint8_t* end = bytes + num;
-            mozilla::PodSet(end - byte_count, value, byte_count);
-        }
-        return ptr;
+    // Without a valid Value tag, a poisoned Value may look like a valid
+    // floating point number. To ensure that we crash more readily when
+    // observing a poisoned Value, we make the poison an invalid ObjectValue.
+    // Unfortunately, this adds about 2% more overhead, so we can only enable
+    // it in debug.
+#if defined(DEBUG)
+    uintptr_t obj;
+    memset(&obj, value, sizeof(obj));
+# if defined(JS_PUNBOX64)
+    obj = obj & ((uintptr_t(1) << JSVAL_TAG_SHIFT) - 1);
+# endif
+    const jsval_layout layout = OBJECT_TO_JSVAL_IMPL((JSObject*)obj);
+
+    size_t value_count = num / sizeof(jsval_layout);
+    size_t byte_count = num % sizeof(jsval_layout);
+    mozilla::PodSet((jsval_layout*)ptr, layout, value_count);
+    if (byte_count) {
+        uint8_t* bytes = static_cast<uint8_t*>(ptr);
+        uint8_t* end = bytes + num;
+        mozilla::PodSet(end - byte_count, value, byte_count);
     }
-
-    return nullptr;
+#else // !DEBUG
+    memset(ptr, value, num);
+#endif // !DEBUG
+    return ptr;
 }
 
-/* Crash diagnostics */
-#if defined(DEBUG) && !defined(MOZ_ASAN)
+/* Crash diagnostics by default in debug and on nightly channel. */
+#if (defined(DEBUG) || defined(NIGHTLY_BUILD)) && !defined(MOZ_ASAN)
 # define JS_CRASH_DIAGNOSTICS 1
 #endif
+
+/* Enable poisoning in crash-diagnostics and zeal builds. */
 #if defined(JS_CRASH_DIAGNOSTICS) || defined(JS_GC_ZEAL)
 # define JS_POISON(p, val, size) Poison(p, val, size)
 #else
 # define JS_POISON(p, val, size) ((void) 0)
 #endif
 
-/* Bug 984101: Disable labeled poisoning until we have poison checking. */
-#define JS_EXTRA_POISON(p, val, size) ((void) 0)
+/* Enable even more poisoning in purely debug builds. */
+#if defined(DEBUG)
+# define JS_EXTRA_POISON(p, val, size) Poison(p, val, size)
+#else
+# define JS_EXTRA_POISON(p, val, size) ((void) 0)
+#endif
 
 /* Basic stats */
 #ifdef DEBUG
 # define JS_BASIC_STATS 1
 #endif
 #ifdef JS_BASIC_STATS
 # include <stdio.h>
 typedef struct JSBasicStats {
--- a/mobile/android/config/mozconfigs/android-api-11/l10n-nightly
+++ b/mobile/android/config/mozconfigs/android-api-11/l10n-nightly
@@ -1,19 +1,16 @@
 . "$topsrcdir/mobile/android/config/mozconfigs/common"
 
 # L10n
 ac_add_options --with-l10n-base=..
 
 # Global options
 ac_add_options --disable-tests
 
-# Mozilla-Central nightlies only since this has a cost in performance
-ac_add_options --enable-js-diagnostics
-
 # Android
 ac_add_options --with-android-min-sdk=11
 ac_add_options --target=arm-linux-androideabi
 
 ac_add_options --with-system-zlib
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
--- a/mobile/android/config/mozconfigs/android-api-9-10-constrained/l10n-nightly
+++ b/mobile/android/config/mozconfigs/android-api-9-10-constrained/l10n-nightly
@@ -1,19 +1,16 @@
 . "$topsrcdir/mobile/android/config/mozconfigs/common"
 
 # L10n
 ac_add_options --with-l10n-base=..
 
 # Global options
 ac_add_options --disable-tests
 
-# Mozilla-Central nightlies only since this has a cost in performance
-ac_add_options --enable-js-diagnostics
-
 # Android
 ac_add_options --with-android-min-sdk=9
 ac_add_options --with-android-max-sdk=10
 ac_add_options --enable-android-resource-constrained
 ac_add_options --target=arm-linux-androideabi
 
 ac_add_options --with-system-zlib
 ac_add_options --enable-updater
--- a/mobile/android/config/mozconfigs/android-x86/l10n-nightly
+++ b/mobile/android/config/mozconfigs/android-x86/l10n-nightly
@@ -1,19 +1,16 @@
 . "$topsrcdir/mobile/android/config/mozconfigs/common"
 
 # L10n
 ac_add_options --with-l10n-base=..
 
 # Global options
 ac_add_options --disable-tests
 
-# Mozilla-Central nightlies only since this has a cost in performance
-ac_add_options --enable-js-diagnostics
-
 # Android
 ac_add_options --target=i386-linux-android
 
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
 export MOZILLA_OFFICIAL=1
 export MOZ_DISABLE_GECKOVIEW=1