Bug 920782 - Don't trigger GCs from threads with an exclusive context. r=billm, a=koi+
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 27 Sep 2013 10:44:25 -0600
changeset 155601 a7c7fa46bd9e1093ec2d11e39cf374be218571cc
parent 155600 5347bbc42e0c97edd6c66a0cb038494e6ba1fe51
child 155602 5721fe0d5284a2eae80212bf23331fc866a643ca
push id4331
push userryanvm@gmail.com
push dateMon, 30 Sep 2013 21:52:55 +0000
treeherdermozilla-aurora@23aa697cf2a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm, koi
bugs920782
milestone26.0a2
Bug 920782 - Don't trigger GCs from threads with an exclusive context. r=billm, a=koi+
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -1955,16 +1955,20 @@ js::TriggerZoneGC(Zone *zone, JS::gcreas
      * If parallel threads are running, wait till they
      * are stopped to trigger GC.
      */
     if (InParallelSection()) {
         ForkJoinSlice::Current()->requestZoneGC(zone, reason);
         return;
     }
 
+    /* Zones in use by a thread with an exclusive context can't be collected. */
+    if (zone->usedByExclusiveThread)
+        return;
+
     JSRuntime *rt = zone->runtimeFromMainThread();
 
     /* Don't trigger GCs when allocating under the operation callback lock. */
     if (rt->currentThreadOwnsOperationCallbackLock())
         return;
 
     if (rt->isHeapBusy())
         return;