Bug 1359245 - Keep a linked list of CycleCollectedJSContexts in the runtime (r=mccr8)
This patch keeps a list of all the cooperatively scheduled contexts that are linked to a runtime. In places where we need to iterate over all contexts (for GC, specifically), it iterates over the list. MozReview-Commit-ID: 3pKJX78f2l0
This commit is contained in:
@@ -69,6 +69,8 @@ CycleCollectedJSContext::~CycleCollectedJSContext()
|
||||
return;
|
||||
}
|
||||
|
||||
mRuntime->RemoveContext(this);
|
||||
|
||||
if (mIsPrimaryContext) {
|
||||
mRuntime->Shutdown(mJSContext);
|
||||
}
|
||||
@@ -112,6 +114,8 @@ CycleCollectedJSContext::~CycleCollectedJSContext()
|
||||
void
|
||||
CycleCollectedJSContext::InitializeCommon()
|
||||
{
|
||||
mRuntime->AddContext(this);
|
||||
|
||||
mOwningThread->SetScriptObserver(this);
|
||||
// The main thread has a base recursion depth of 0, workers of 1.
|
||||
mBaseRecursionDepth = RecursionDepth();
|
||||
|
||||
Reference in New Issue
Block a user