Backout bug 807535 (r=regression,a=regression)
authorBill McCloskey <wmccloskey@mozilla.com>
Sat, 03 Nov 2012 11:12:31 -0700
changeset 116662 901aaea897a0996905b6b540bef5ffff758ce38b
parent 116661 76e2abf198c0d0815ec0717d9fe11258540ab6a0
child 116663 18270cef7783e939c9d261f5c5d4001510f897f9
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersregression, regression
bugs807535
milestone18.0a2
Backout bug 807535 (r=regression,a=regression)
js/src/jscompartment.cpp
js/src/jscompartment.h
js/src/jsgc.cpp
--- a/js/src/jscompartment.cpp
+++ b/js/src/jscompartment.cpp
@@ -43,17 +43,16 @@ using namespace js::gc;
 JSCompartment::JSCompartment(JSRuntime *rt)
   : rt(rt),
     principals(NULL),
     global_(NULL),
 #ifdef JSGC_GENERATIONAL
     gcStoreBuffer(&gcNursery),
 #endif
     needsBarrier_(false),
-    ionUsingBarriers_(false),
     gcScheduled(false),
     gcState(NoGC),
     gcPreserveCode(false),
     gcBytes(0),
     gcTriggerBytes(0),
     gcHeapGrowthFactor(3.0),
     gcNextCompartment(NULL),
     hold(false),
@@ -127,30 +126,28 @@ JSCompartment::init(JSContext *cx)
         gcStoreBuffer.disable();
     }
 #endif
 
     return debuggees.init();
 }
 
 void
-JSCompartment::setNeedsBarrier(bool needs, ShouldUpdateIon updateIon)
+JSCompartment::setNeedsBarrier(bool needs)
 {
 #ifdef JS_METHODJIT
     /* ClearAllFrames calls compileBarriers() and needs the old value. */
     bool old = compileBarriers();
     if (compileBarriers(needs) != old)
         mjit::ClearAllFrames(this);
 #endif
 
 #ifdef JS_ION
-    if (updateIon == UpdateIon && needs != ionUsingBarriers_) {
+    if (needsBarrier_ != needs)
         ion::ToggleBarriers(this, needs);
-        ionUsingBarriers_ = needs;
-    }
 #endif
 
     needsBarrier_ = needs;
 }
 
 #ifdef JS_ION
 bool
 JSCompartment::ensureIonCompartmentExists(JSContext *cx)
--- a/js/src/jscompartment.h
+++ b/js/src/jscompartment.h
@@ -150,37 +150,31 @@ struct JSCompartment
 
 #ifdef JSGC_GENERATIONAL
     js::gc::Nursery              gcNursery;
     js::gc::StoreBuffer          gcStoreBuffer;
 #endif
 
   private:
     bool                         needsBarrier_;
-    bool                         ionUsingBarriers_;
   public:
 
     bool needsBarrier() const {
         return needsBarrier_;
     }
 
     bool compileBarriers(bool needsBarrier) const {
         return needsBarrier || rt->gcZeal() == js::gc::ZealVerifierPreValue;
     }
 
     bool compileBarriers() const {
         return compileBarriers(needsBarrier());
     }
 
-    enum ShouldUpdateIon {
-        DontUpdateIon,
-        UpdateIon
-    };
-
-    void setNeedsBarrier(bool needs, ShouldUpdateIon updateIon);
+    void setNeedsBarrier(bool needs);
 
     static size_t OffsetOfNeedsBarrier() {
         return offsetof(JSCompartment, needsBarrier_);
     }
 
     js::GCMarker *barrierTracer() {
         JS_ASSERT(needsBarrier_);
         return &rt->gcMarker;
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -4157,17 +4157,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);
                 c->setGCState(JSCompartment::NoGC);
                 wasMarking = true;
             }
         }
     }
 
     if (wasMarking)
         rt->gcMarker.reset();
@@ -4215,40 +4215,35 @@ AutoGCSlice::AutoGCSlice(JSRuntime *rt)
      * During incremental GC, the compartment's active flag determines whether
      * there are stack frames active for any of its scripts. Normally this flag
      * is set at the beginning of the mark phase. During incremental GC, we also
      * set it at the start of every phase.
      */
     rt->stackSpace.markActiveCompartments();
 
     for (GCCompartmentsIter c(rt); !c.done(); c.next()) {
-        /*
-         * Clear needsBarrier early so we don't do any write barriers during
-         * GC. We don't need to update the Ion barriers (which is expensive)
-         * because Ion code doesn't run during GC. If need be, we'll update the
-         * Ion barriers in ~AutoGCSlice.
-         */
+        /* Clear this early so we don't do any write barriers during GC. */
         if (c->isGCMarking()) {
             JS_ASSERT(c->needsBarrier());
-            c->setNeedsBarrier(false, JSCompartment::DontUpdateIon);
+            c->setNeedsBarrier(false);
         } else {
             JS_ASSERT(!c->needsBarrier());
         }
     }
 }
 
 AutoGCSlice::~AutoGCSlice()
 {
     for (GCCompartmentsIter c(runtime); !c.done(); c.next()) {
         if (c->isGCMarking()) {
-            c->setNeedsBarrier(true, JSCompartment::UpdateIon);
+            c->setNeedsBarrier(true);
             c->arenas.prepareForIncrementalGC(runtime);
         } else {
             JS_ASSERT(c->isGCSweeping());
-            c->setNeedsBarrier(false, JSCompartment::UpdateIon);
+            c->setNeedsBarrier(false);
         }
     }
 }
 
 static void
 PushZealSelectedObjects(JSRuntime *rt)
 {
 #ifdef JS_GC_ZEAL
@@ -4395,17 +4390,17 @@ IncrementalCollectSlice(JSRuntime *rt,
         if (rt->gcSweepOnBackgroundThread)
             rt->gcHelperThread.startBackgroundSweep(gckind == GC_SHRINK);
 
         rt->gcIncrementalState = NO_INCREMENTAL;
         break;
 
       default:
         JS_ASSERT(false);
-    }
+     }
 }
 
 class IncrementalSafety
 {
     const char *reason_;
 
     IncrementalSafety(const char *reason) : reason_(reason) {}
 
@@ -5351,17 +5346,17 @@ StartVerifyPreBarriers(JSRuntime *rt)
         node = NextNode(node);
     }
 
     rt->gcVerifyPreData = trc;
     rt->gcIncrementalState = MARK;
     rt->gcMarker.start(rt);
     for (CompartmentsIter c(rt); !c.done(); c.next()) {
         PurgeJITCaches(c);
-        c->setNeedsBarrier(true, JSCompartment::UpdateIon);
+        c->setNeedsBarrier(true);
         c->arenas.purge();
     }
 
     return;
 
 oom:
     rt->gcIncrementalState = NO_INCREMENTAL;
     trc->~VerifyPreTracer();
@@ -5434,17 +5429,17 @@ EndVerifyPreBarriers(JSRuntime *rt)
     bool compartmentCreated = false;
 
     /* We need to disable barriers before tracing, which may invoke barriers. */
     for (CompartmentsIter c(rt); !c.done(); c.next()) {
         if (!c->needsBarrier())
             compartmentCreated = true;
 
         PurgeJITCaches(c);
-        c->setNeedsBarrier(false, JSCompartment::UpdateIon);
+        c->setNeedsBarrier(false);
     }
 
     /*
      * We need to bump gcNumber so that the methodjit knows that jitcode has
      * been discarded.
      */
     JS_ASSERT(trc->number == rt->gcNumber);
     rt->gcNumber++;