Bug 1346874 - Disable slow gray mark checks on Android, r=mccr8
authorSteve Fink <sfink@mozilla.com>
Thu, 16 Mar 2017 15:41:36 -0700
changeset 348056 b47db00299f4aae7c30df3d05e22a3fadddd0204
parent 348055 d1e870c4540505fadf47c979792ba3d2a27b2d68
child 348057 b66398167216f8c1caabcdfca0c5742c6e9ce207
push id88139
push usersfink@mozilla.com
push dateThu, 16 Mar 2017 23:24:14 +0000
treeherdermozilla-inbound@b47db00299f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1346874
milestone55.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 1346874 - Disable slow gray mark checks on Android, r=mccr8 MozReview-Commit-ID: GyycxPpNDQA
js/src/jsgc.cpp
xpcom/base/CycleCollectedJSContext.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -7940,22 +7940,15 @@ js::gc::detail::CellIsNotGray(const Cell
 
     // The cell is gray, but may eventually be marked black if we are in an
     // incremental GC and the cell is reachable by something on the mark stack.
 
     auto rt = tc->runtimeFromAnyThread();
     if (!rt->gc.isIncrementalGCInProgress() || tc->zone()->wasGCStarted())
         return false;
 
-    // Bug 1346874 - The stack check is expensive. Android tests are already
-    // slow enough that this check can easily push them over the threshold to a
-    // timeout. So always assume the best on Android.
-# ifdef ANDROID
-    return true;
-# else
     Zone* sourceZone = rt->gc.marker.stackContainsCrossZonePointerTo(tc);
     if (sourceZone && sourceZone->wasGCStarted())
         return true;
 
     return false;
-# endif
 }
 #endif
--- a/xpcom/base/CycleCollectedJSContext.cpp
+++ b/xpcom/base/CycleCollectedJSContext.cpp
@@ -1314,18 +1314,25 @@ CycleCollectedJSContext::FixWeakMappingG
 }
 
 void
 CycleCollectedJSContext::CheckGrayBits() const
 {
   MOZ_ASSERT(mJSContext);
   MOZ_ASSERT(!JS::IsIncrementalGCInProgress(mJSContext),
              "Don't call CheckGrayBits during a GC.");
+
+#ifndef ANDROID
+  // Bug 1346874 - The gray state check is expensive. Android tests are already
+  // slow enough that this check can easily push them over the threshold to a
+  // timeout.
+
   MOZ_ASSERT(js::CheckGrayMarkingState(mJSContext));
   MOZ_ASSERT(CheckWeakMappingGrayBitsTracer::Check(mJSContext));
+#endif
 }
 
 bool
 CycleCollectedJSContext::AreGCGrayBitsValid() const
 {
   MOZ_ASSERT(mJSContext);
   return js::AreGCGrayBitsValid(mJSContext);
 }