Bug 836524 - Zone renaming part 5 (r=jonco)
authorBill McCloskey <wmccloskey@mozilla.com>
Wed, 06 Feb 2013 18:08:42 -0800
changeset 130998 e39eee4423143cb529f0a9b9e441f2a3ca424a7e
parent 130997 3b53112a2a2336b4828447fec7db62e531ddc122
child 130999 7153a907e6b9a7f2b28f1d989efbc0c45bd6859e
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs836524
milestone21.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 836524 - Zone renaming part 5 (r=jonco)
js/src/jsapi.cpp
js/src/jsgc.cpp
js/src/vm/Debugger.cpp
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -924,18 +924,18 @@ JSRuntime::init(uint32_t maxbytes)
     if (!(atomsCompartment = this->new_<JSCompartment>(this)) ||
         !atomsCompartment->init(NULL) ||
         !compartments.append(atomsCompartment))
     {
         js_delete(atomsCompartment);
         return false;
     }
 
-    atomsCompartment->isSystem = true;
-    atomsCompartment->setGCLastBytes(8192, GC_NORMAL);
+    atomsCompartment->zone()->isSystem = true;
+    atomsCompartment->zone()->setGCLastBytes(8192, GC_NORMAL);
 
     if (!InitAtoms(this))
         return false;
 
     if (!InitRuntimeNumberState(this))
         return false;
 
     dtoaState = js_NewDtoaState();
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -1924,18 +1924,18 @@ GCMarker::GrayCallback(JSTracer *trc, vo
     GCMarker *gcmarker = static_cast<GCMarker *>(trc);
     gcmarker->appendGrayRoot(*thingp, kind);
 }
 
 size_t
 GCMarker::sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const
 {
     size_t size = stack.sizeOfExcludingThis(mallocSizeOf);
-    for (CompartmentsIter c(runtime); !c.done(); c.next())
-        size += c->gcGrayRoots.sizeOfExcludingThis(mallocSizeOf);
+    for (ZonesIter zone(runtime); !zone.done(); zone.next())
+        size += zone->gcGrayRoots.sizeOfExcludingThis(mallocSizeOf);
     return size;
 }
 
 void
 js::SetMarkStackLimit(JSRuntime *rt, size_t limit)
 {
     JS_ASSERT(!rt->isHeapBusy());
     rt->gcMarker.setSizeLimit(limit);
@@ -3266,22 +3266,22 @@ GetNextZoneGroup(JSRuntime *rt)
 
     if (rt->gcAbortSweepAfterCurrentGroup) {
         JS_ASSERT(!rt->gcIsIncremental);
         for (GCZoneGroupIter zone(rt); !zone.done(); zone.next()) {
             JS_ASSERT(!zone->gcNextGraphComponent);
             JS_ASSERT(zone->isGCMarking());
             zone->setNeedsBarrier(false, Zone::UpdateIon);
             zone->setGCState(Zone::NoGC);
+            zone->gcGrayRoots.clearAndFree();
         }
 
         for (GCCompartmentGroupIter comp(rt); !comp.done(); comp.next()) {
             ArrayBufferObject::resetArrayBufferList(comp);
             ResetGrayList(comp);
-            comp->gcGrayRoots.clearAndFree();
         }
 
         rt->gcAbortSweepAfterCurrentGroup = false;
         rt->gcCurrentZoneGroup = NULL;
     }
 }
 
 /*
@@ -4011,18 +4011,18 @@ ResetIncrementalGC(JSRuntime *rt, const 
         JS_ASSERT(!rt->gcStrictCompartmentChecking);
 
         break;
       }
 
       case SWEEP:
         rt->gcMarker.reset();
 
-        for (CompartmentsIter c(rt); !c.done(); c.next())
-            c->scheduledForDestruction = false;
+        for (ZonesIter zone(rt); !zone.done(); zone.next())
+            zone->scheduledForDestruction = false;
 
         /* Finish sweeping the current zone group, then abort. */
         rt->gcAbortSweepAfterCurrentGroup = true;
         IncrementalCollectSlice(rt, SliceBudget::Unlimited, gcreason::RESET, GC_NORMAL);
 
         {
             gcstats::AutoPhase ap(rt->gcStats, gcstats::PHASE_WAIT_BACKGROUND_THREAD);
             rt->gcHelperThread.waitBackgroundSweepOrAllocEnd();
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -1889,17 +1889,17 @@ Debugger::addDebuggee(JSContext *cx, uns
 JSBool
 Debugger::addAllGlobalsAsDebuggees(JSContext *cx, unsigned argc, Value *vp)
 {
     THIS_DEBUGGER(cx, argc, vp, "addAllGlobalsAsDebuggees", args, dbg);
     AutoDebugModeGC dmgc(cx->runtime);
     for (CompartmentsIter c(cx->runtime); !c.done(); c.next()) {
         if (c == dbg->object->compartment())
             continue;
-        c->scheduledForDestruction = false;
+        c->zone()->scheduledForDestruction = false;
         GlobalObject *global = c->maybeGlobal();
         if (global) {
             Rooted<GlobalObject*> rg(cx, global);
             dbg->addDebuggeeGlobal(cx, rg, dmgc);
         }
     }
 
     args.rval().setUndefined();
@@ -2557,17 +2557,17 @@ Debugger::findAllGlobals(JSContext *cx, 
 {
     THIS_DEBUGGER(cx, argc, vp, "findAllGlobals", args, dbg);
 
     RootedObject result(cx, NewDenseEmptyArray(cx));
     if (!result)
         return false;
 
     for (CompartmentsIter c(cx->runtime); !c.done(); c.next()) {
-        c->scheduledForDestruction = false;
+        c->zone()->scheduledForDestruction = false;
 
         GlobalObject *global = c->maybeGlobal();
         if (global) {
             /*
              * We pulled |global| out of nowhere, so it's possible that it was
              * marked gray by XPConnect. Since we're now exposing it to JS code,
              * we need to mark it black.
              */