Bug 1328967 - Allow GCZonesIter to be used by helper threads during GC r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 20 Jan 2017 12:09:07 +0000
changeset 358366 c077b729fc6076505fef8f3909653ebc550a086f
parent 358365 63c9d5f388ee125184fcdb0c1b506ab432a77867
child 358367 44c956b966c7e36da697fd5517450e2bc93255c3
push id10621
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 16:02:43 +0000
treeherdermozilla-aurora@dca7b42e6c67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1328967
milestone53.0a1
Bug 1328967 - Allow GCZonesIter to be used by helper threads during GC r=sfink
js/src/jsgcinlines.h
--- a/js/src/jsgcinlines.h
+++ b/js/src/jsgcinlines.h
@@ -379,18 +379,19 @@ class GrayObjectIter : public ZoneCellIt
 
 class GCZonesIter
 {
   private:
     ZonesIter zone;
 
   public:
     explicit GCZonesIter(JSRuntime* rt, ZoneSelector selector = WithAtoms) : zone(rt, selector) {
-        MOZ_ASSERT(CurrentThreadCanAccessRuntime(rt) && rt->isHeapBusy());
-        if (!zone->isCollecting())
+        MOZ_ASSERT((CurrentThreadCanAccessRuntime(rt) && rt->isHeapBusy()) ||
+                   CurrentThreadIsPerformingGC());
+        if (!zone->isCollectingFromAnyThread())
             next();
     }
 
     bool done() const { return zone.done(); }
 
     void next() {
         MOZ_ASSERT(!done());
         do {