Bug 1188620 - Use PersistentRooted for asyncActivation roots; r=fitzgen

This commit is contained in:
Terrence Cole 2015-07-29 10:23:14 -07:00
parent 192b87a7e1
commit 266bd44fa0
3 changed files with 4 additions and 10 deletions

View File

@ -365,12 +365,6 @@ js::gc::GCRuntime::markRuntime(JSTracer* trc,
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++)

View File

@ -126,8 +126,8 @@ JSRuntime::JSRuntime(JSRuntime* parentRuntime)
profilerSampleBufferGen_(0),
profilerSampleBufferLapCount_(1),
asmJSActivationStack_(nullptr),
asyncStackForNewActivations(nullptr),
asyncCauseForNewActivations(nullptr),
asyncStackForNewActivations(this),
asyncCauseForNewActivations(this),
asyncCallIsExplicit(false),
entryMonitor(nullptr),
parentRuntime(parentRuntime),

View File

@ -690,12 +690,12 @@ struct JSRuntime : public JS::shadow::Runtime,
* 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