Bug 808067 - Fix needsBarrier (r=sstangl,jonco)
authorBill McCloskey <wmccloskey@mozilla.com>
Mon, 05 Nov 2012 14:22:35 -0800
changeset 112355 ef966ef53b2330c4598c079a9a2f52c5a1f50c54
parent 112354 6dcc0beba62ce3b7946be41d63e9a584163791a3
child 112356 ed1c5d55d104a435e241fa825930ed4697073874
push id23812
push useremorley@mozilla.com
push dateTue, 06 Nov 2012 14:01:34 +0000
treeherdermozilla-central@f4aeed115e54 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstangl, jonco
bugs808067
milestone19.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 808067 - Fix needsBarrier (r=sstangl,jonco)
js/src/jit-test/lib/prolog.js
js/src/jsgc.cpp
--- a/js/src/jit-test/lib/prolog.js
+++ b/js/src/jit-test/lib/prolog.js
@@ -27,10 +27,14 @@ if (!("selectforgc" in this)) {
 if (!("verifyprebarriers" in this)) {
   verifyprebarriers = function() { }
 }
 
 if (!("verifypostbarriers" in this)) {
   verifypostbarriers = function() { }
 }
 
+if (!("gcPreserveCode" in this)) {
+  gcPreserveCode = function() { }
+}
+
 if ("options" in this)
     options("allow_xml");
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -4074,17 +4074,17 @@ ResetIncrementalGC(JSRuntime *rt, const 
         return;
 
     /* Cancel and ongoing marking. */
     bool wasMarking = false;
     {
         AutoCopyFreeListToArenas copy(rt);
         for (GCCompartmentsIter c(rt); !c.done(); c.next()) {
             if (c->isGCMarking()) {
-                c->setNeedsBarrier(false, JSCompartment::DontUpdateIon);
+                c->setNeedsBarrier(false, JSCompartment::UpdateIon);
                 c->setGCState(JSCompartment::NoGC);
                 wasMarking = true;
             }
         }
     }
 
     if (wasMarking)
         rt->gcMarker.reset();
@@ -4149,22 +4149,22 @@ AutoGCSlice::AutoGCSlice(JSRuntime *rt)
         } else {
             JS_ASSERT(!c->needsBarrier());
         }
     }
 }
 
 AutoGCSlice::~AutoGCSlice()
 {
-    for (GCCompartmentsIter c(runtime); !c.done(); c.next()) {
+    /* We can't use GCCompartmentsIter if this is the end of the last slice. */
+    for (CompartmentsIter c(runtime); !c.done(); c.next()) {
         if (c->isGCMarking()) {
             c->setNeedsBarrier(true, JSCompartment::UpdateIon);
             c->arenas.prepareForIncrementalGC(runtime);
         } else {
-            JS_ASSERT(c->isGCSweeping());
             c->setNeedsBarrier(false, JSCompartment::UpdateIon);
         }
     }
 }
 
 static void
 PushZealSelectedObjects(JSRuntime *rt)
 {