Bug 710947 - Allow hash table elements to be removed during GC (r=luke)
authorBill McCloskey <wmccloskey@mozilla.com>
Fri, 16 Dec 2011 14:01:44 -0800
changeset 84465 9d6469ffd57761204107d889275dc8b79a4c98ea
parent 84464 b407ff123b6f6418195282a314965bfebba66ebc
child 84466 fb3fd223b5d8cb82c507cd86c7b5e298b055f7f3
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs710947
milestone11.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 710947 - Allow hash table elements to be removed during GC (r=luke)
js/src/jit-test/tests/basic/bug710947.js
js/src/jsgc.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/bug710947.js
@@ -0,0 +1,8 @@
+// |jit-test| allow-oom;
+function startTest() {
+ if (typeof document != "object" 
+    || !document.location.href.match(/jsreftest.html/))  {}
+};
+gczeal(4);
+startTest();
+ArrayBuffer( 946684800000 );
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -2091,18 +2091,17 @@ MarkRuntime(JSTracer *trc)
         if (JSTraceDataOp op = rt->gcGrayRootsTraceOp)
             (*op)(trc, rt->gcGrayRootsData);
     }
 }
 
 void
 TriggerGC(JSRuntime *rt, gcstats::Reason reason)
 {
-    JS_ASSERT(!rt->gcRunning);
-    if (rt->gcIsNeeded)
+    if (rt->gcRunning || rt->gcIsNeeded)
         return;
 
     /*
      * Trigger the GC when it is safe to call an operation callback on any
      * thread.
      */
     rt->gcIsNeeded = true;
     rt->gcTriggerCompartment = NULL;