Bug 1188620 - Use PersistentRooted for asyncActivation roots; r=fitzgen
authorTerrence Cole <terrence@mozilla.com>
Wed, 29 Jul 2015 10:23:14 -0700
changeset 255955 d6dea3334b6c311107b2fe1e482ca2ad7e133a24
parent 255954 0aed5c00a7354bf60deaf8f11a6e0f05c9c51bc8
child 255956 d1288e84b4a039332a52ba194877100b0b6ec598
push id29163
push usercbook@mozilla.com
push dateTue, 04 Aug 2015 11:01:35 +0000
treeherdermozilla-central@5cf4d2f7f2f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfitzgen
bugs1188620
milestone42.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 1188620 - Use PersistentRooted for asyncActivation roots; r=fitzgen
js/src/gc/RootMarking.cpp
js/src/vm/Runtime.cpp
js/src/vm/Runtime.h
--- a/js/src/gc/RootMarking.cpp
+++ b/js/src/gc/RootMarking.cpp
@@ -360,22 +360,16 @@ js::gc::GCRuntime::markRuntime(JSTracer*
         for (RootRange r = rootsHash.all(); !r.empty(); r.popFront()) {
             const RootEntry& entry = r.front();
             TraceRoot(trc, entry.key(), entry.value());
         }
 
         MarkPersistentRootedChains(trc);
     }
 
-    if (rt->asyncStackForNewActivations)
-        TraceRoot(trc, &rt->asyncStackForNewActivations, "asyncStackForNewActivations");
-
-    if (rt->asyncCauseForNewActivations)
-        TraceRoot(trc, &rt->asyncCauseForNewActivations, "asyncCauseForNewActivations");
-
     if (rt->scriptAndCountsVector) {
         ScriptAndCountsVector& vec = *rt->scriptAndCountsVector;
         for (size_t i = 0; i < vec.length(); i++)
             TraceRoot(trc, &vec[i].script, "scriptAndCountsVector");
     }
 
     if (!rt->isBeingDestroyed() && !rt->isHeapMinorCollecting()) {
         gcstats::AutoPhase ap(stats, gcstats::PHASE_MARK_RUNTIME_DATA);
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -121,18 +121,18 @@ JSRuntime::JSRuntime(JSRuntime* parentRu
     jitJSContext(nullptr),
     jitActivation(nullptr),
     jitStackLimit_(0xbad),
     activation_(nullptr),
     profilingActivation_(nullptr),
     profilerSampleBufferGen_(0),
     profilerSampleBufferLapCount_(1),
     asmJSActivationStack_(nullptr),
-    asyncStackForNewActivations(nullptr),
-    asyncCauseForNewActivations(nullptr),
+    asyncStackForNewActivations(this),
+    asyncCauseForNewActivations(this),
     asyncCallIsExplicit(false),
     entryMonitor(nullptr),
     parentRuntime(parentRuntime),
     interrupt_(false),
     telemetryCallback(nullptr),
     handlingSignal(false),
     interruptCallback(nullptr),
     exclusiveAccessLock(nullptr),
--- a/js/src/vm/Runtime.h
+++ b/js/src/vm/Runtime.h
@@ -685,22 +685,22 @@ struct JSRuntime : public JS::shadow::Ru
      * Youngest frame of a saved stack that will be picked up as an async stack
      * by any new Activation, and is nullptr when no async stack should be used.
      *
      * The JS::AutoSetAsyncStackForNewCalls class can be used to set this.
      *
      * New activations will reset this to nullptr on construction after getting
      * the current value, and will restore the previous value on destruction.
      */
-    js::SavedFrame* asyncStackForNewActivations;
+    JS::PersistentRooted<js::SavedFrame*> asyncStackForNewActivations;
 
     /*
      * Value of asyncCause to be attached to asyncStackForNewActivations.
      */
-    JSString* asyncCauseForNewActivations;
+    JS::PersistentRooted<JSString*> asyncCauseForNewActivations;
 
     /*
      * True if the async call was explicitly requested, e.g. via
      * callFunctionWithAsyncStack.
      */
     bool asyncCallIsExplicit;
 
     /* If non-null, report JavaScript entry points to this monitor. */