Commit WIP... crashes in GC now, due to objects that aren't actually finalized even though they claim to be.
authorbenjamin@smedbergs.us
Mon, 19 Nov 2007 14:11:04 -0500
changeset 53 6d63a1ff8c33466eaa0be64595c2985fe6059cab
parent 52 ebc8ffe5a3009a1c6c10c324d3e9066f18486d87
child 54 b08f9569127f154ba647dee4782ca9ecc751d9ee
push id1
push userbsmedberg@mozilla.com
push dateTue, 15 Apr 2008 21:51:22 +0000
Commit WIP... crashes in GC now, due to objects that aren't actually finalized even though they claim to be.
chromereg-gc
disable-gc
necko-gc2
nogc
root-compmgr
series
xpconnect-allocations
--- a/chromereg-gc
+++ b/chromereg-gc
@@ -15,17 +15,17 @@ diff --git a/chrome/src/nsChromeRegistry
 diff --git a/chrome/src/nsChromeRegistry.h b/chrome/src/nsChromeRegistry.h
 --- a/chrome/src/nsChromeRegistry.h
 +++ b/chrome/src/nsChromeRegistry.h
 @@ -134,7 +134,7 @@ private:
    NS_HIDDEN_(nsresult) ProcessNewChromeBuffer(char *aBuffer, PRInt32 aLength, nsIURI* aManifest);
  
  public:
 -  struct ProviderEntry
-+  struct ProviderEntry : XPCOMGCFinalizedObject
++  struct ProviderEntry : XPCOMGCFinalizedObject, public MMgc::GCFinalizedBase
    {
      ProviderEntry(const nsACString& aProvider, nsIURI* aBase) :
        provider(aProvider),
 @@ -169,7 +169,7 @@ public:
    private:
      ProviderEntry* GetProvider(const nsACString& aPreferred, MatchType aType);
  
 -    nsVoidArray mArray;
deleted file mode 100644
--- a/disable-gc
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp
---- a/js/src/jsgc.cpp
-+++ b/js/src/jsgc.cpp
-@@ -1304,6 +1304,8 @@ void
- void
- js_GC(JSContext *cx, JSGCInvocationKind gckind)
- {
-+    return;
-+
-     JSRuntime *rt;
-     JSTracer trc;
- #ifdef JS_THREADSAFE
--- a/necko-gc2
+++ b/necko-gc2
@@ -1,21 +1,22 @@
 diff --git a/netwerk/protocol/http/src/nsHttpConnectionMgr.h b/netwerk/protocol/http/src/nsHttpConnectionMgr.h
 --- a/netwerk/protocol/http/src/nsHttpConnectionMgr.h
 +++ b/netwerk/protocol/http/src/nsHttpConnectionMgr.h
-@@ -52,7 +52,7 @@ class nsHttpPipeline;
+@@ -52,7 +52,8 @@ class nsHttpPipeline;
  
  //-----------------------------------------------------------------------------
  
 -class nsHttpConnectionMgr
 +class nsHttpConnectionMgr : public XPCOMGCFinalizedObject
++                          , public MMgc::GCFinalizedBase
  {
  public:
  
-@@ -86,17 +86,14 @@ public:
+@@ -86,17 +87,14 @@ public:
      // NOTE: functions below may be called on any thread.
      //-------------------------------------------------------------------------
  
 -    nsrefcnt AddRef()
 -    {
 -        return PR_AtomicIncrement(&mRef);
 +    void AddRef()
 +    {
new file mode 100644
--- /dev/null
+++ b/nogc
@@ -0,0 +1,13 @@
+diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp
+--- a/js/src/jsgc.cpp
++++ b/js/src/jsgc.cpp
+@@ -1311,6 +1311,9 @@ js_GC(JSContext *cx, JSGCInvocationKind 
+     JSContext *acx, *iter;
+ #endif
+ 
++    // Disable GC completely for the moment
++    return;
++
+     rt = cx->runtime;
+ #ifdef JS_THREADSAFE
+     /* Avoid deadlock. */
new file mode 100644
--- /dev/null
+++ b/root-compmgr
@@ -0,0 +1,423 @@
+diff --git a/xpcom/build/nsXPComInit.cpp b/xpcom/build/nsXPComInit.cpp
+--- a/xpcom/build/nsXPComInit.cpp
++++ b/xpcom/build/nsXPComInit.cpp
+@@ -329,7 +329,7 @@ static PRBool CheckUpdateFile()
+ }
+ 
+ 
+-nsComponentManagerImpl* nsComponentManagerImpl::gComponentManager = NULL;
++nsComponentManagerImpl::Root* nsComponentManagerImpl::gComponentManager = NULL;
+ PRBool gXPCOMShuttingDown = PR_FALSE;
+ 
+ // For each class that wishes to support nsIClassInfo, add a line like this
+@@ -572,7 +572,10 @@ NS_InitXPCOM3(nsIServiceManager* *result
+         return rv;
+     }
+ 
+-    nsComponentManagerImpl::gComponentManager = compMgr;
++    nsComponentManagerImpl::gComponentManager =
++        new nsComponentManagerImpl::Root(compMgr);
++    if (!nsComponentManagerImpl::gComponentManager)
++        return NS_ERROR_OUT_OF_MEMORY;
+ 
+     if (result) {
+         nsIServiceManager *serviceManager =
+@@ -637,12 +640,14 @@ NS_InitXPCOM3(nsIServiceManager* *result
+     nsIInterfaceInfoManager* iim =
+         xptiInterfaceInfoManager::GetInterfaceInfoManagerNoAddRef();
+ 
+-    if (CheckUpdateFile() || NS_FAILED(
+-        nsComponentManagerImpl::gComponentManager->ReadPersistentRegistry())) {
++    if (CheckUpdateFile() ||
++        NS_FAILED(nsComponentManagerImpl::gComponentManager->instance->
++                  ReadPersistentRegistry())) {
+         // If the component registry is out of date, malformed, or incomplete,
+         // autoregister the default component directories.
+         (void) iim->AutoRegisterInterfaces();
+-        nsComponentManagerImpl::gComponentManager->AutoRegister(nsnull);
++        nsComponentManagerImpl::gComponentManager->instance->
++            AutoRegister(nsnull);
+     }
+ 
+     // After autoreg, but before we actually instantiate any components,
+@@ -762,7 +767,7 @@ NS_ShutdownXPCOM(nsIServiceManager* serv
+ 
+     // Shutdown global servicemanager
+     if (nsComponentManagerImpl::gComponentManager) {
+-        nsComponentManagerImpl::gComponentManager->FreeServices();
++        nsComponentManagerImpl::gComponentManager->instance->FreeServices();
+     }
+ 
+     nsProxyObjectManager::Shutdown();
+@@ -800,7 +805,7 @@ NS_ShutdownXPCOM(nsIServiceManager* serv
+     // Shutdown xpcom. This will release all loaders and cause others holding
+     // a refcount to the component manager to release it.
+     if (nsComponentManagerImpl::gComponentManager) {
+-        rv = (nsComponentManagerImpl::gComponentManager)->Shutdown();
++        rv = nsComponentManagerImpl::gComponentManager->instance->Shutdown();
+         NS_ASSERTION(NS_SUCCEEDED(rv), "Component Manager shutdown failed.");
+     } else
+         NS_WARNING("Component Manager was never created ...");
+@@ -813,6 +818,7 @@ NS_ShutdownXPCOM(nsIServiceManager* serv
+ 
+     // Finally, release the component manager last because it unloads the
+     // libraries:
++    delete nsComponentManagerImpl::gComponentManager;
+     nsComponentManagerImpl::gComponentManager = nsnull;
+ 
+ #ifdef DEBUG
+diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp
+--- a/xpcom/components/nsComponentManager.cpp
++++ b/xpcom/components/nsComponentManager.cpp
+@@ -218,7 +218,8 @@ nsGetServiceFromCategory::get(const nsII
+     nsXPIDLCString value;
+     nsICategoryManager* catman = nsnull;
+     void *result = NULL;
+-    nsComponentManagerImpl *compMgr = nsComponentManagerImpl::gComponentManager;
++    nsComponentManagerImpl *compMgr =
++        nsComponentManagerImpl::gComponentManager->instance;
+     if (!compMgr) {
+         rv = NS_ERROR_NOT_INITIALIZED;
+         goto error;
+@@ -1259,7 +1260,7 @@ AutoRegEntryWriter(nsIHashable *aKey, PR
+     nsILocalFile* lf(do_QueryInterface(aKey));
+ 
+     nsCAutoString location;
+-    nsComponentManagerImpl::gComponentManager->
++    nsComponentManagerImpl::gComponentManager->instance->
+         RegistryLocationForFile(lf, location);
+ 
+     PR_fprintf(fd, "%s,%lld\n", location.get(), (PRInt64) aTimestamp);
+@@ -3234,7 +3235,7 @@ RegisterStaticModule(const char *key, ns
+                      nsTArray<DeferredModule, GCAllocator> &deferred)
+ {
+     nsresult rv = module->
+-        RegisterSelf(nsComponentManagerImpl::gComponentManager,
++        RegisterSelf(nsComponentManagerImpl::gComponentManager->instance,
+                      nsnull, key, staticComponentType);
+ 
+     if (NS_ERROR_FACTORY_REGISTER_AGAIN == rv) {
+@@ -3527,7 +3528,7 @@ nsFactoryEntry::nsFactoryEntry(const nsC
+     mLoaderType(aLoaderType),
+     mLocationKey(
+       ArenaStrdup(aLocationKey,
+-                  &nsComponentManagerImpl::gComponentManager->mArena)),
++                  &nsComponentManagerImpl::gComponentManager->instance->mArena)),
+     mParent(aParent)
+ {
+ }
+@@ -3541,7 +3542,7 @@ nsFactoryEntry::ReInit(LoaderType  aLoad
+     if (!mLocationKey || strcmp(mLocationKey, aLocationKey)) {
+         mLocationKey =
+             ArenaStrdup(aLocationKey,
+-                        &nsComponentManagerImpl::gComponentManager->mArena);
++                        &nsComponentManagerImpl::gComponentManager->instance->mArena);
+     }
+ }
+ 
+@@ -3557,20 +3558,20 @@ nsFactoryEntry::GetFactory(nsIFactory **
+         nsIModule* module = nsnull;
+ 
+         if (mLoaderType == NS_LOADER_TYPE_STATIC) {
+-            rv = nsComponentManagerImpl::gComponentManager->
++            rv = nsComponentManagerImpl::gComponentManager->instance->
+                 mStaticModuleLoader.
+                 GetModuleFor(mLocationKey,
+                              &module);
+         }
+         else {
+             nsILocalFile* moduleFile = nsnull;
+-            rv = nsComponentManagerImpl::gComponentManager->
++            rv = nsComponentManagerImpl::gComponentManager->instance->
+                 FileForRegistryLocation(nsDependentCString(mLocationKey),
+                                         &moduleFile);
+             NS_ENSURE_SUCCESS(rv, rv);
+ 
+             nsIModuleLoader* loader =
+-                nsComponentManagerImpl::gComponentManager->
++                nsComponentManagerImpl::gComponentManager->instance->
+                     LoaderForType(mLoaderType);
+             if (!loader)
+                 return NS_ERROR_FAILURE;
+@@ -3588,7 +3589,7 @@ nsFactoryEntry::GetFactory(nsIFactory **
+         }
+ 
+         rv = module->
+-            GetClassObject(nsComponentManagerImpl::gComponentManager,
++            GetClassObject(nsComponentManagerImpl::gComponentManager->instance,
+                            mCid,
+                            NS_GET_IID(nsIFactory),
+                            getter_AddRefs(mFactory));
+@@ -3620,35 +3621,24 @@ NS_COM nsresult
+ NS_COM nsresult
+ NS_GetComponentManager(nsIComponentManager* *result)
+ {
+-    if (nsComponentManagerImpl::gComponentManager == nsnull)
+-    {
+-        // XPCOM needs initialization.
+-        nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);
+-        if (NS_FAILED(rv))
+-            return rv;
+-    }
+-
+-    *result = static_cast<nsIComponentManager*>
+-                         (nsComponentManagerImpl::gComponentManager);
++    if (!nsComponentManagerImpl::gComponentManager) {
++        NS_ERROR("XPCOM was not initialized.");
++        return NS_ERROR_NOT_INITIALIZED;
++    }
++
++    *result = nsComponentManagerImpl::gComponentManager->instance;
+     return NS_OK;
+ }
+ 
+ NS_COM nsresult
+ NS_GetServiceManager(nsIServiceManager* *result)
+ {
+-    nsresult rv = NS_OK;
+-
+-    if (nsComponentManagerImpl::gComponentManager == nsnull)
+-    {
+-        // XPCOM needs initialization.
+-        rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);
+-    }
+-
+-    if (NS_FAILED(rv))
+-        return rv;
+-
+-    *result = static_cast<nsIServiceManager*>
+-                         (nsComponentManagerImpl::gComponentManager);
++    if (!nsComponentManagerImpl::gComponentManager) {
++        NS_ERROR("XPCOM was not initalized.");
++        return NS_ERROR_NOT_INITIALIZED;
++    }
++
++    *result = nsComponentManagerImpl::gComponentManager->instance;
+     return NS_OK;
+ }
+ 
+@@ -3656,18 +3646,10 @@ NS_COM nsresult
+ NS_COM nsresult
+ NS_GetComponentRegistrar(nsIComponentRegistrar* *result)
+ {
+-    nsresult rv = NS_OK;
+-
+-    if (nsComponentManagerImpl::gComponentManager == nsnull)
+-    {
+-        // XPCOM needs initialization.
+-        rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);
+-    }
+-
+-    if (NS_FAILED(rv))
+-        return rv;
+-
+-    *result = static_cast<nsIComponentRegistrar*>
+-                         (nsComponentManagerImpl::gComponentManager);
++    if (!nsComponentManagerImpl::gComponentManager) {
++        NS_ERROR("XPCOM was not initalized.");
++        return NS_ERROR_NOT_INITIALIZED;
++    }
++    *result = nsComponentManagerImpl::gComponentManager->instance;
+     return NS_OK;
+ }
+diff --git a/xpcom/components/nsComponentManager.h b/xpcom/components/nsComponentManager.h
+--- a/xpcom/components/nsComponentManager.h
++++ b/xpcom/components/nsComponentManager.h
+@@ -169,7 +169,19 @@ public:
+     // nsComponentManagerImpl methods:
+     nsComponentManagerImpl();
+ 
+-    static nsComponentManagerImpl* gComponentManager;
++    class Root : public MMgc::GCRoot
++    {
++    public:
++        Root(nsComponentManagerImpl *compMgr)
++            : MMgc::GCRoot(NS_GetGC())
++            , instance(compMgr)
++        {
++        }
++
++        nsComponentManagerImpl* instance;
++    };
++
++    static Root *gComponentManager;
+     nsresult Init(nsStaticModuleInfo const *aStaticModules,
+                   PRUint32 aStaticModuleCount);
+     // NOTE: XPCOM initialization must call either ReadPersistentRegistry or
+diff --git a/xpcom/components/nsNativeComponentLoader.cpp b/xpcom/components/nsNativeComponentLoader.cpp
+--- a/xpcom/components/nsNativeComponentLoader.cpp
++++ b/xpcom/components/nsNativeComponentLoader.cpp
+@@ -92,11 +92,6 @@ NS_IMPL_QUERY_INTERFACE1(nsNativeModuleL
+ NS_IMPL_QUERY_INTERFACE1(nsNativeModuleLoader, 
+                          nsIModuleLoader)
+ 
+-NS_IMPL_ADDREF_USING_AGGREGATOR(nsNativeModuleLoader,
+-                                nsComponentManagerImpl::gComponentManager)
+-NS_IMPL_RELEASE_USING_AGGREGATOR(nsNativeModuleLoader,
+-                                 nsComponentManagerImpl::gComponentManager)
+-
+ nsresult
+ nsNativeModuleLoader::Init()
+ {
+@@ -183,7 +178,7 @@ nsNativeModuleLoader::LoadModule(nsILoca
+ 
+     if (proc) {
+         nsIModule* module;
+-        rv = proc(nsComponentManagerImpl::gComponentManager,
++        rv = proc(nsComponentManagerImpl::gComponentManager->instance,
+                   aFile,
+                   &module);
+         if (NS_SUCCEEDED(rv)) {
+diff --git a/xpcom/components/nsServiceManagerObsolete.cpp b/xpcom/components/nsServiceManagerObsolete.cpp
+--- a/xpcom/components/nsServiceManagerObsolete.cpp
++++ b/xpcom/components/nsServiceManagerObsolete.cpp
+@@ -55,7 +55,7 @@ nsServiceManager::GetGlobalServiceManage
+         
+     // this method does not addref for historical reasons.
+     // we return the nsIServiceManagerObsolete interface via a cast.
+-    *result =  (nsIServiceManager*) static_cast<nsIServiceManagerObsolete*>(nsComponentManagerImpl::gComponentManager);
++    *result =  (nsIServiceManager*) static_cast<nsIServiceManagerObsolete*>(nsComponentManagerImpl::gComponentManager->instance);
+     return NS_OK;
+ }
+ 
+@@ -76,7 +76,7 @@ nsServiceManager::GetService(const nsCID
+     if (nsComponentManagerImpl::gComponentManager == nsnull)
+         return NS_ERROR_UNEXPECTED;
+     
+-    return nsComponentManagerImpl::gComponentManager->GetService(aClass, aIID, (void**)result);
++    return nsComponentManagerImpl::gComponentManager->instance->GetService(aClass, aIID, (void**)result);
+ }
+ 
+ nsresult
+@@ -97,7 +97,7 @@ nsServiceManager::RegisterService(const 
+     if (nsComponentManagerImpl::gComponentManager == nsnull)
+         return NS_ERROR_UNEXPECTED;
+     
+-    return nsComponentManagerImpl::gComponentManager->RegisterService(aClass, aService);
++    return nsComponentManagerImpl::gComponentManager->instance->RegisterService(aClass, aService);
+ }
+ 
+ nsresult
+@@ -108,7 +108,7 @@ nsServiceManager::UnregisterService(cons
+     if (nsComponentManagerImpl::gComponentManager == nsnull)
+         return NS_ERROR_UNEXPECTED;
+     
+-    return nsComponentManagerImpl::gComponentManager->UnregisterService(aClass);
++    return nsComponentManagerImpl::gComponentManager->instance->UnregisterService(aClass);
+ }
+ 
+ ////////////////////////////////////////////////////////////////////////////////
+@@ -124,7 +124,7 @@ nsServiceManager::GetService(const char*
+     if (nsComponentManagerImpl::gComponentManager == nsnull)
+         return NS_ERROR_UNEXPECTED;
+ 
+-    return nsComponentManagerImpl::gComponentManager->GetServiceByContractID(aContractID, aIID, (void**)result);
++    return nsComponentManagerImpl::gComponentManager->instance->GetServiceByContractID(aContractID, aIID, (void**)result);
+ }
+ 
+ nsresult
+@@ -145,7 +145,7 @@ nsServiceManager::RegisterService(const 
+     if (nsComponentManagerImpl::gComponentManager == nsnull)
+         return NS_ERROR_UNEXPECTED;
+     
+-    return nsComponentManagerImpl::gComponentManager->RegisterService(aContractID, aService);
++    return nsComponentManagerImpl::gComponentManager->instance->RegisterService(aContractID, aService);
+ }
+ 
+ nsresult
+@@ -162,6 +162,6 @@ nsServiceManager::UnregisterService(cons
+     if (nsComponentManagerImpl::gComponentManager == nsnull)
+         return NS_ERROR_UNEXPECTED;
+ 
+-    return nsComponentManagerImpl::gComponentManager->UnregisterService(aContractID);
++    return nsComponentManagerImpl::gComponentManager->instance->UnregisterService(aContractID);
+ }
+ 
+diff --git a/xpcom/components/nsStaticComponentLoader.cpp b/xpcom/components/nsStaticComponentLoader.cpp
+--- a/xpcom/components/nsStaticComponentLoader.cpp
++++ b/xpcom/components/nsStaticComponentLoader.cpp
+@@ -137,8 +137,8 @@ nsStaticModuleLoader::EnumerateModules(S
+         if (!c->module) {
+             nsIModule* module;
+             nsresult rv = c->info.
+-                getModule(nsComponentManagerImpl::gComponentManager, nsnull,
+-                          &module);
++                getModule(nsComponentManagerImpl::gComponentManager->instance,
++                          nsnull, &module);
+             WB(NS_GetGC(), mInfoHash.entryStore, &c->module, module);
+             
+             LOG(("nSCL: EnumerateModules(): %lx\n", rv));
+@@ -165,8 +165,8 @@ nsStaticModuleLoader::GetModuleFor(const
+     if (!info->module) {
+         nsIModule* module;
+         rv = info->info.
+-            getModule(nsComponentManagerImpl::gComponentManager, nsnull,
+-                      &module);
++            getModule(nsComponentManagerImpl::gComponentManager->instance,
++                      nsnull, &module);
+  
+         WB(NS_GetGC(), mInfoHash.entryStore, &info->module, module);
+ 
+diff --git a/xpcom/glue/nsComponentManagerUtils.cpp b/xpcom/glue/nsComponentManagerUtils.cpp
+--- a/xpcom/glue/nsComponentManagerUtils.cpp
++++ b/xpcom/glue/nsComponentManagerUtils.cpp
+@@ -77,7 +77,8 @@ nsresult
+ nsresult
+ CallGetService(const nsCID &aCID, const nsIID &aIID, void **aResult)
+ {
+-    nsComponentManagerImpl *compMgr = nsComponentManagerImpl::gComponentManager;
++    nsComponentManagerImpl *compMgr =
++        nsComponentManagerImpl::gComponentManager->instance;
+     NS_ENSURE_TRUE(compMgr, NS_ERROR_NOT_INITIALIZED);
+ 
+     return compMgr->nsComponentManagerImpl::GetService(aCID, aIID, aResult);
+@@ -86,7 +87,8 @@ nsresult
+ nsresult
+ CallGetService(const char *aContractID, const nsIID &aIID, void **aResult)
+ {
+-    nsComponentManagerImpl *compMgr = nsComponentManagerImpl::gComponentManager;
++    nsComponentManagerImpl *compMgr =
++        nsComponentManagerImpl::gComponentManager->instance;
+     NS_ENSURE_TRUE(compMgr, NS_ERROR_NOT_INITIALIZED);
+ 
+     return compMgr->
+@@ -150,7 +152,8 @@ CallCreateInstance(const nsCID &aCID, ns
+ CallCreateInstance(const nsCID &aCID, nsISupports *aDelegate,
+                    const nsIID &aIID, void **aResult)
+ {
+-    nsComponentManagerImpl *compMgr = nsComponentManagerImpl::gComponentManager;
++    nsComponentManagerImpl *compMgr =
++        nsComponentManagerImpl::gComponentManager->instance;
+     NS_ENSURE_TRUE(compMgr, NS_ERROR_NOT_INITIALIZED);
+ 
+     return compMgr->
+@@ -161,7 +164,8 @@ CallCreateInstance(const char *aContract
+ CallCreateInstance(const char *aContractID, nsISupports *aDelegate,
+                    const nsIID &aIID, void **aResult)
+ {
+-    nsComponentManagerImpl *compMgr = nsComponentManagerImpl::gComponentManager;
++    nsComponentManagerImpl *compMgr =
++        nsComponentManagerImpl::gComponentManager->instance;
+     NS_ENSURE_TRUE(compMgr, NS_ERROR_NOT_INITIALIZED);
+ 
+     return compMgr->
+@@ -173,7 +177,8 @@ nsresult
+ nsresult
+ CallGetClassObject(const nsCID &aCID, const nsIID &aIID, void **aResult)
+ {
+-    nsComponentManagerImpl *compMgr = nsComponentManagerImpl::gComponentManager;
++    nsComponentManagerImpl *compMgr =
++        nsComponentManagerImpl::gComponentManager->instance;
+     NS_ENSURE_TRUE(compMgr, NS_ERROR_NOT_INITIALIZED);
+ 
+     return compMgr->
+@@ -183,7 +188,8 @@ nsresult
+ nsresult
+ CallGetClassObject(const char *aContractID, const nsIID &aIID, void **aResult)
+ {
+-    nsComponentManagerImpl *compMgr = nsComponentManagerImpl::gComponentManager;
++    nsComponentManagerImpl *compMgr =
++        nsComponentManagerImpl::gComponentManager->instance;
+     NS_ENSURE_TRUE(compMgr, NS_ERROR_NOT_INITIALIZED);
+ 
+     return compMgr->
--- a/series
+++ b/series
@@ -41,21 +41,22 @@ observerlist-gc
 jscomponentloader-gc
 necko-gc
 layout-suck2
 automatic-garburator.patch
 embedding-print64
 64bit
 imgcache
 more-xptcall
-disable-gc
 shell-loginit
 jscomponentloader-gc2
 console-heapallocate
 compmgr-more
 content-hashtables
 comptr-rewrite.patch2
 xslt-gc
 chromereg-gc
 necko-gc2
 jscomponentloader-gc3
 xpcomproxy-gcalloc-patch2
 gcobject-nodelete.patch
+root-compmgr
+nogc
--- a/xpconnect-allocations
+++ b/xpconnect-allocations
@@ -10,17 +10,17 @@ diff --git a/js/src/xpconnect/src/xpcpri
  {
  public:
      NS_DECL_ISUPPORTS
 @@ -1075,7 +1075,7 @@ xpc_TraceForValidWrapper(JSTracer *trc, 
  /***************************************************************************/
  // XPCWrappedNativeScope is one-to-one with a JS global object.
  
 -class XPCWrappedNativeScope
-+class XPCWrappedNativeScope : XPCOMGCFinalizedObject
++class XPCWrappedNativeScope : XPCOMGCFinalizedObject, MMgc::GCFinalizedBase
  {
  public:
  
 @@ -1292,7 +1292,7 @@ private:
  
  // Tight. No virtual methods.
  
 -class XPCNativeInterface