Bug 882162: Part 9 - Kill nsCycleCollectionJSRuntime. r=mccr8

This commit is contained in:
Kyle Huey
2013-06-18 12:02:16 -07:00
parent 96c85edc43
commit bfee51278e
8 changed files with 23 additions and 223 deletions

View File

@@ -11,6 +11,7 @@
#include "jsprf.h"
#include "nsCycleCollectionNoteRootCallback.h"
#include "nsCycleCollectionParticipant.h"
#include "nsCycleCollector.h"
#include "nsDOMJSUtils.h"
#include "nsLayoutStatics.h"
#include "xpcpublic.h"
@@ -396,13 +397,6 @@ sJSZoneCycleCollectorGlobal = {
NS_IMPL_CYCLE_COLLECTION_NATIVE_VTABLE(JSZoneParticipant)
};
// XXXkhuey this is totally wrong ...
nsCycleCollectionParticipant*
xpc_JSZoneParticipant()
{
return sJSZoneCycleCollectorGlobal.GetParticipant();
}
CycleCollectedJSRuntime::CycleCollectedJSRuntime(uint32_t aMaxbytes,
JSUseHelperThreads aUseHelperThreads,
bool aExpectUnrootedGlobals)
@@ -422,10 +416,14 @@ CycleCollectedJSRuntime::CycleCollectedJSRuntime(uint32_t aMaxbytes,
JS_SetGrayGCRootsTracer(mJSRuntime, TraceGrayJS, this);
mJSHolders.Init(512);
nsCycleCollector_registerJSRuntime(this);
}
CycleCollectedJSRuntime::~CycleCollectedJSRuntime()
{
nsCycleCollector_forgetJSRuntime();
JS_DestroyRuntime(mJSRuntime);
mJSRuntime = nullptr;
}