Bug 999631 - Disable startup cache via a dedicated flag. r=mshal
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 23 Apr 2014 04:57:00 -0400
changeset 200093 d1da7f04c1098a35cf009c9ed2ae66ab5307fe63
parent 200092 6bb86257e36aac92c89cd5eb7fc27a66e957c635
child 200094 94b14c87a75ef99c59429ed991e7db820f66b0e5
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs999631
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 999631 - Disable startup cache via a dedicated flag. r=mshal
configure.in
startupcache/StartupCache.cpp
toolkit/mozapps/installer/packager.py
--- a/configure.in
+++ b/configure.in
@@ -7442,16 +7442,33 @@ MOZ_ARG_ENABLE_BOOL(reflow-perf,
 [  --enable-reflow-perf    Enable reflow performance tracing],
     MOZ_REFLOW_PERF=1,
     MOZ_REFLOW_PERF= )
 if test -n "$MOZ_REFLOW_PERF"; then
     AC_DEFINE(MOZ_REFLOW_PERF)
 fi
 
 dnl ========================================================
+dnl = Offer a way to disable the startup cache
+dnl ========================================================
+MOZ_DISABLE_STARTUPCACHE=
+
+MOZ_ARG_DISABLE_BOOL(startupcache,
+[  --disable-startupcache          Disable startup cache ],
+    MOZ_DISABLE_STARTUPCACHE=1,
+    MOZ_DISABLE_STARTUPCACHE=)
+
+dnl bug 988880: disable startup cache on b2g
+if test -n "$MOZ_B2G"; then
+  MOZ_DISABLE_STARTUPCACHE=1
+fi
+
+AC_SUBST(MOZ_DISABLE_STARTUPCACHE)
+
+dnl ========================================================
 dnl = Enable Radio Interface for B2G (Gonk usually)
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(b2g-ril,
 [  --enable-b2g-ril      Set compile flags necessary for testing B2G Radio Interface Layer via network sockets ],
     MOZ_B2G_RIL=1,
     MOZ_B2G_RIL=,
     MOZ_B2G_RIL=$_PLATFORM_HAVE_RIL )
 if test -n "$MOZ_B2G_RIL"; then
--- a/startupcache/StartupCache.cpp
+++ b/startupcache/StartupCache.cpp
@@ -88,17 +88,17 @@ static const char sMetroStartupCacheName
 
 StartupCache*
 StartupCache::GetSingleton()
 {
   if (!gStartupCache) {
     if (XRE_GetProcessType() != GeckoProcessType_Default) {
       return nullptr;
     }
-#ifdef MOZ_B2G
+#ifdef MOZ_DISABLE_STARTUP_CACHE
     return nullptr;
 #endif
 
     StartupCache::InitSingleton();
   }
 
   return StartupCache::gStartupCache;
 }
--- a/toolkit/mozapps/installer/packager.py
+++ b/toolkit/mozapps/installer/packager.py
@@ -371,17 +371,18 @@ def main():
         for p, f in copier:
             if not isinstance(f, Jarrer):
                 continue
             key = JarLog.canonicalize(os.path.join(args.destination, p))
             if key in log:
                 f.preload(log[key])
 
     # Fill startup cache
-    if isinstance(formatter, OmniJarFormatter) and launcher.can_launch():
+    if isinstance(formatter, OmniJarFormatter) and launcher.can_launch() \
+      and buildconfig.substs['MOZ_DISABLE_STARTUPCACHE'] != '1':
         if buildconfig.substs['LIBXUL_SDK']:
             gre_path = mozpack.path.join(buildconfig.substs['LIBXUL_DIST'],
                                          'bin')
         else:
             gre_path = None
         for base in sorted([[p for p in [mozpack.path.join('bin', b), b]
                             if os.path.exists(os.path.join(args.source, p))][0]
                            for b in sink.packager.get_bases()]):