Bug 920782 - Don't trigger GCs from threads with an exclusive context. r=billm, a=koi+
--- 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;