Backed out changeset 61f6c63bcb3d (bug 928056) for m-oth failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 18 Oct 2013 15:44:30 -0400
changeset 165201 a46ff1a56160ed32a98ad1bc55b4d7ff6dd31522
parent 165200 fc7cc3c1dccfb9892e14b5639ccb533aba270156
child 165202 acc16ae0e638e5aed663c63425e507d974ec0417
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs928056
milestone27.0a1
backs out61f6c63bcb3d5a723e6d460e5eea6f547589b602
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
Backed out changeset 61f6c63bcb3d (bug 928056) for m-oth failures.
js/src/gc/GCInternals.h
js/src/gc/Iteration.cpp
js/src/jsgc.cpp
js/src/jsworkers.cpp
js/src/jsworkers.h
js/src/vm/Runtime.h
--- a/js/src/gc/GCInternals.h
+++ b/js/src/gc/GCInternals.h
@@ -15,54 +15,52 @@ namespace js {
 namespace gc {
 
 void
 MarkRuntime(JSTracer *trc, bool useSavedRoots = false);
 
 void
 BufferGrayRoots(GCMarker *gcmarker);
 
-class AutoCopyFreeListToArenas
-{
+class AutoCopyFreeListToArenas {
     JSRuntime *runtime;
 
   public:
     AutoCopyFreeListToArenas(JSRuntime *rt);
     ~AutoCopyFreeListToArenas();
 };
 
 struct AutoFinishGC
 {
     AutoFinishGC(JSRuntime *rt);
 };
 
 /*
  * This class should be used by any code that needs to exclusive access to the
  * heap in order to trace through it...
  */
-class AutoTraceSession
-{
+class AutoTraceSession {
   public:
     AutoTraceSession(JSRuntime *rt, HeapState state = Tracing);
     ~AutoTraceSession();
 
   protected:
     JSRuntime *runtime;
 
   private:
     AutoTraceSession(const AutoTraceSession&) MOZ_DELETE;
     void operator=(const AutoTraceSession&) MOZ_DELETE;
 
     js::HeapState prevState;
+    AutoPauseWorkersForGC pause;
 };
 
 struct AutoPrepareForTracing
 {
     AutoFinishGC finish;
-    AutoPauseWorkersForTracing pause;
     AutoTraceSession session;
     AutoCopyFreeListToArenas copy;
 
     AutoPrepareForTracing(JSRuntime *rt);
 };
 
 class IncrementalSafety
 {
--- a/js/src/gc/Iteration.cpp
+++ b/js/src/gc/Iteration.cpp
@@ -99,14 +99,13 @@ js::IterateGrayObjects(Zone *zone, GCThi
 }
 
 JS_PUBLIC_API(void)
 JS_IterateCompartments(JSRuntime *rt, void *data,
                        JSIterateCompartmentCallback compartmentCallback)
 {
     JS_ASSERT(!rt->isHeapBusy());
 
-    AutoPauseWorkersForTracing pause(rt);
     AutoTraceSession session(rt);
 
     for (CompartmentsIter c(rt); !c.done(); c.next())
         (*compartmentCallback)(rt, data, c);
 }
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -4071,47 +4071,44 @@ EndSweepPhase(JSRuntime *rt, JSGCInvocat
     FinishMarkingValidation(rt);
 
     rt->gcLastGCTime = PRMJ_Now();
 }
 
 namespace {
 
 /* ...while this class is to be used only for garbage collection. */
-class AutoGCSession : AutoTraceSession
-{
-    AutoPauseWorkersForTracing pause;
-
+class AutoGCSession : AutoTraceSession {
   public:
     explicit AutoGCSession(JSRuntime *rt);
     ~AutoGCSession();
 };
 
 } /* anonymous namespace */
 
 /* Start a new heap session. */
 AutoTraceSession::AutoTraceSession(JSRuntime *rt, js::HeapState heapState)
   : runtime(rt),
-    prevState(rt->heapState)
+    prevState(rt->heapState),
+    pause(rt)
 {
     JS_ASSERT(!rt->noGCOrAllocationCheck);
     JS_ASSERT(!rt->isHeapBusy());
     JS_ASSERT(heapState != Idle);
     rt->heapState = heapState;
 }
 
 AutoTraceSession::~AutoTraceSession()
 {
     JS_ASSERT(runtime->isHeapBusy());
     runtime->heapState = prevState;
 }
 
 AutoGCSession::AutoGCSession(JSRuntime *rt)
-  : AutoTraceSession(rt, MajorCollecting),
-    pause(rt)
+  : AutoTraceSession(rt, MajorCollecting)
 {
     runtime->gcIsNeeded = false;
     runtime->gcInterFrameGC = true;
 
     runtime->gcNumber++;
 
 #ifdef DEBUG
     // Threads with an exclusive context should never pause while they are in
@@ -4786,17 +4783,16 @@ AutoFinishGC::AutoFinishGC(JSRuntime *rt
         JS::FinishIncrementalGC(rt, JS::gcreason::API);
     }
 
     gc::FinishBackgroundFinalize(rt);
 }
 
 AutoPrepareForTracing::AutoPrepareForTracing(JSRuntime *rt)
   : finish(rt),
-    pause(rt),
     session(rt),
     copy(rt)
 {
     RecordNativeStackTopForGC(rt);
 }
 
 JSCompartment *
 js::NewCompartment(JSContext *cx, Zone *zone, JSPrincipals *principals,
--- a/js/src/jsworkers.cpp
+++ b/js/src/jsworkers.cpp
@@ -922,18 +922,17 @@ WorkerThread::threadLoop()
             handleParseWorkload(state);
         else if (state.canStartCompressionTask())
             handleCompressionWorkload(state);
         else
             MOZ_ASSUME_UNREACHABLE("No task to perform");
     }
 }
 
-AutoPauseWorkersForTracing::AutoPauseWorkersForTracing(JSRuntime *rt
-                                                       MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
+AutoPauseWorkersForGC::AutoPauseWorkersForGC(JSRuntime *rt MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
   : runtime(rt), needsUnpause(false), oldExclusiveThreadsPaused(rt->exclusiveThreadsPaused)
 {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 
     rt->exclusiveThreadsPaused = true;
 
     if (!runtime->workerThreadState)
         return;
@@ -941,33 +940,33 @@ AutoPauseWorkersForTracing::AutoPauseWor
     JS_ASSERT(CurrentThreadCanAccessRuntime(runtime));
 
     WorkerThreadState &state = *runtime->workerThreadState;
     if (!state.numThreads)
         return;
 
     AutoLockWorkerThreadState lock(state);
 
-    // Tolerate reentrant use of AutoPauseWorkersForTracing.
+    // Tolerate reentrant use of AutoPauseWorkersForGC.
     if (state.shouldPause) {
         JS_ASSERT(state.numPaused == state.numThreads);
         return;
     }
 
     needsUnpause = true;
 
     state.shouldPause = 1;
 
     while (state.numPaused != state.numThreads) {
         state.notifyAll(WorkerThreadState::PRODUCER);
         state.wait(WorkerThreadState::CONSUMER);
     }
 }
 
-AutoPauseWorkersForTracing::~AutoPauseWorkersForTracing()
+AutoPauseWorkersForGC::~AutoPauseWorkersForGC()
 {
     runtime->exclusiveThreadsPaused = oldExclusiveThreadsPaused;
 
     if (!needsUnpause)
         return;
 
     WorkerThreadState &state = *runtime->workerThreadState;
     AutoLockWorkerThreadState lock(state);
@@ -982,17 +981,17 @@ AutoPauseCurrentWorkerThread::AutoPauseC
                                                            MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
   : cx(cx)
 {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 
     // If the current thread is a worker thread, treat it as paused while
     // the caller is waiting for another worker thread to complete. Otherwise
     // we will not wake up and mark this as paused due to the loop in
-    // AutoPauseWorkersForTracing.
+    // AutoPauseWorkersForGC.
     if (cx->workerThread()) {
         WorkerThreadState &state = *cx->workerThreadState();
         JS_ASSERT(state.isLocked());
 
         state.numPaused++;
         if (state.numPaused == state.numThreads)
             state.notifyAll(WorkerThreadState::CONSUMER);
     }
@@ -1082,23 +1081,22 @@ SourceCompressionTask::complete()
 
 const jschar *
 ScriptSource::getOffThreadCompressionChars(ExclusiveContext *cx)
 {
     JS_ASSERT(ready());
     return nullptr;
 }
 
-AutoPauseWorkersForTracing::AutoPauseWorkersForTracing(JSRuntime *rt
-                                                       MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
+AutoPauseWorkersForGC::AutoPauseWorkersForGC(JSRuntime *rt MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
 {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 }
 
-AutoPauseWorkersForTracing::~AutoPauseWorkersForTracing()
+AutoPauseWorkersForGC::~AutoPauseWorkersForGC()
 {
 }
 
 AutoPauseCurrentWorkerThread::AutoPauseCurrentWorkerThread(ExclusiveContext *cx
                                                            MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
 {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 }
--- a/js/src/jsworkers.h
+++ b/js/src/jsworkers.h
@@ -323,28 +323,28 @@ WorkerThread::maybePause()
         AutoLockWorkerThreadState lock(*runtime->workerThreadState);
         pause();
     }
 }
 
 #endif // JS_WORKER_THREADS
 
 /* Pause any threads that are running jobs off thread during GC activity. */
-class AutoPauseWorkersForTracing
+class AutoPauseWorkersForGC
 {
 #ifdef JS_WORKER_THREADS
     JSRuntime *runtime;
     bool needsUnpause;
     mozilla::DebugOnly<bool> oldExclusiveThreadsPaused;
 #endif
     MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 
   public:
-    AutoPauseWorkersForTracing(JSRuntime *rt MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
-    ~AutoPauseWorkersForTracing();
+    AutoPauseWorkersForGC(JSRuntime *rt MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
+    ~AutoPauseWorkersForGC();
 };
 
 /*
  * If the current thread is a worker thread, treat it as paused during this
  * class's lifetime. This should be used at any time the current thread is
  * waiting for a worker to complete.
  */
 class AutoPauseCurrentWorkerThread
--- a/js/src/vm/Runtime.h
+++ b/js/src/vm/Runtime.h
@@ -670,17 +670,17 @@ struct MallocProvider
 
 namespace gc {
 class MarkingValidator;
 } // namespace gc
 
 typedef Vector<JS::Zone *, 4, SystemAllocPolicy> ZoneVector;
 
 class AutoLockForExclusiveAccess;
-class AutoPauseWorkersForTracing;
+class AutoPauseWorkersForGC;
 class ThreadDataIter;
 
 void RecomputeStackLimit(JSRuntime *rt, StackKind kind);
 
 } // namespace js
 
 struct JSRuntime : public JS::shadow::Runtime,
                    public js::MallocProvider<JSRuntime>
@@ -784,17 +784,17 @@ struct JSRuntime : public JS::shadow::Ru
     mozilla::DebugOnly<PRThread *> exclusiveAccessOwner;
     mozilla::DebugOnly<bool> mainThreadHasExclusiveAccess;
     mozilla::DebugOnly<bool> exclusiveThreadsPaused;
 
     /* Number of non-main threads with an ExclusiveContext. */
     size_t numExclusiveThreads;
 
     friend class js::AutoLockForExclusiveAccess;
-    friend class js::AutoPauseWorkersForTracing;
+    friend class js::AutoPauseWorkersForGC;
     friend class js::ThreadDataIter;
 
   public:
     void setUsedByExclusiveThread(JS::Zone *zone);
     void clearUsedByExclusiveThread(JS::Zone *zone);
 
 #endif // JS_THREADSAFE && JS_ION