Bug 1456512 - Do not unmark gray during minor collections, r=jonco
authorSteve Fink <sfink@mozilla.com>
Thu, 17 May 2018 16:13:06 -0700
changeset 419178 5d8bf331bc54cbaaef752a215ee6341a5c30cca2
parent 419177 a5347b2c7f0cdf7fb40748a75f37192de7d54bc5
child 419179 dc793fbd9e1a6bc28f09d81fcb24670bf8f6e6bf
push id34029
push usershindli@mozilla.com
push dateMon, 21 May 2018 21:30:22 +0000
treeherdermozilla-central@51f2535c7974 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1456512
milestone62.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 1456512 - Do not unmark gray during minor collections, r=jonco
js/src/gc/Cell.h
js/src/tests/non262/regress/regress-1456512-greyreadbarrier.js
--- a/js/src/gc/Cell.h
+++ b/js/src/gc/Cell.h
@@ -388,17 +388,17 @@ TenuredCell::readBarrier(TenuredCell* th
         Cell* tmp = thing;
         TraceManuallyBarrieredGenericPointerEdge(shadowZone->barrierTracer(), &tmp, "read barrier");
         MOZ_ASSERT(tmp == thing);
     }
 
     if (thing->isMarkedGray()) {
         // There shouldn't be anything marked grey unless we're on the main thread.
         MOZ_ASSERT(CurrentThreadCanAccessRuntime(thing->runtimeFromAnyThread()));
-        if (!RuntimeFromMainThreadIsHeapMajorCollecting(shadowZone))
+        if (!JS::CurrentThreadIsHeapCollecting())
             JS::UnmarkGrayGCThingRecursively(JS::GCCellPtr(thing, thing->getTraceKind()));
     }
 }
 
 void
 AssertSafeToSkipBarrier(TenuredCell* thing);
 
 /* static */ MOZ_ALWAYS_INLINE void
new file mode 100644
--- /dev/null
+++ b/js/src/tests/non262/regress/regress-1456512-greyreadbarrier.js
@@ -0,0 +1,7 @@
+var wm = new WeakMap();
+grayRoot().map = wm;
+wm = null;
+gczeal(13, 7);
+var lfOffThreadGlobal = newGlobal();
+
+reportCompare('do not crash', 'do not crash', 'did not crash!');