From cb066c43df6dbade3650459ff6167dc30e799683 Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Sun, 17 Nov 2013 14:47:01 -0800 Subject: [PATCH] Bug 937157, part 11 - Remove XPC_DUMP_AT_SHUTDOWN. r=bholle --- js/xpconnect/src/XPCJSRuntime.cpp | 81 +++------------------- js/xpconnect/src/XPCWrappedNativeScope.cpp | 12 ---- js/xpconnect/src/nsXPConnect.cpp | 11 --- 3 files changed, 8 insertions(+), 96 deletions(-) diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index f8b1c04fa4a..1eca48f6c4b 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -1516,18 +1516,6 @@ XPCJSRuntime::~XPCJSRuntime() if (mCallContext) mCallContext->SystemIsBeingShutDown(); -#ifdef XPC_DUMP_AT_SHUTDOWN - { - // count the total JSContexts in use - JSContext* iter = nullptr; - int count = 0; - while (JS_ContextIterator(Runtime(), &iter)) - count ++; - if (count) - printf("deleting XPCJSRuntime with %d live JSContexts\n", count); - } -#endif - auto rtPrivate = static_cast(JS_GetRuntimePrivate(Runtime())); delete rtPrivate; JS_SetRuntimePrivate(Runtime(), nullptr); @@ -1540,89 +1528,36 @@ XPCJSRuntime::~XPCJSRuntime() // clean up and destroy maps... if (mWrappedJSMap) { -#ifdef XPC_DUMP_AT_SHUTDOWN - uint32_t count = mWrappedJSMap->Count(); - if (count) - printf("deleting XPCJSRuntime with %d live wrapped JSObject\n", (int)count); -#endif mWrappedJSMap->ShutdownMarker(); delete mWrappedJSMap; } - if (mWrappedJSClassMap) { -#ifdef XPC_DUMP_AT_SHUTDOWN - uint32_t count = mWrappedJSClassMap->Count(); - if (count) - printf("deleting XPCJSRuntime with %d live nsXPCWrappedJSClass\n", (int)count); -#endif + if (mWrappedJSClassMap) delete mWrappedJSClassMap; - } - if (mIID2NativeInterfaceMap) { -#ifdef XPC_DUMP_AT_SHUTDOWN - uint32_t count = mIID2NativeInterfaceMap->Count(); - if (count) - printf("deleting XPCJSRuntime with %d live XPCNativeInterfaces\n", (int)count); -#endif + if (mIID2NativeInterfaceMap) delete mIID2NativeInterfaceMap; - } - if (mClassInfo2NativeSetMap) { -#ifdef XPC_DUMP_AT_SHUTDOWN - uint32_t count = mClassInfo2NativeSetMap->Count(); - if (count) - printf("deleting XPCJSRuntime with %d live XPCNativeSets\n", (int)count); -#endif + if (mClassInfo2NativeSetMap) delete mClassInfo2NativeSetMap; - } - if (mNativeSetMap) { -#ifdef XPC_DUMP_AT_SHUTDOWN - uint32_t count = mNativeSetMap->Count(); - if (count) - printf("deleting XPCJSRuntime with %d live XPCNativeSets\n", (int)count); -#endif + if (mNativeSetMap) delete mNativeSetMap; - } if (mMapLock) XPCAutoLock::DestroyLock(mMapLock); - if (mThisTranslatorMap) { -#ifdef XPC_DUMP_AT_SHUTDOWN - uint32_t count = mThisTranslatorMap->Count(); - if (count) - printf("deleting XPCJSRuntime with %d live ThisTranslator\n", (int)count); -#endif + if (mThisTranslatorMap) delete mThisTranslatorMap; - } - if (mNativeScriptableSharedMap) { -#ifdef XPC_DUMP_AT_SHUTDOWN - uint32_t count = mNativeScriptableSharedMap->Count(); - if (count) - printf("deleting XPCJSRuntime with %d live XPCNativeScriptableShared\n", (int)count); -#endif + if (mNativeScriptableSharedMap) delete mNativeScriptableSharedMap; - } - if (mDyingWrappedNativeProtoMap) { -#ifdef XPC_DUMP_AT_SHUTDOWN - uint32_t count = mDyingWrappedNativeProtoMap->Count(); - if (count) - printf("deleting XPCJSRuntime with %d live but dying XPCWrappedNativeProto\n", (int)count); -#endif + if (mDyingWrappedNativeProtoMap) delete mDyingWrappedNativeProtoMap; - } - if (mDetachedWrappedNativeProtoMap) { -#ifdef XPC_DUMP_AT_SHUTDOWN - uint32_t count = mDetachedWrappedNativeProtoMap->Count(); - if (count) - printf("deleting XPCJSRuntime with %d live detached XPCWrappedNativeProto\n", (int)count); -#endif + if (mDetachedWrappedNativeProtoMap) delete mDetachedWrappedNativeProtoMap; - } #ifdef MOZ_ENABLE_PROFILER_SPS // Tell the profiler that the runtime is gone diff --git a/js/xpconnect/src/XPCWrappedNativeScope.cpp b/js/xpconnect/src/XPCWrappedNativeScope.cpp index 502088076dd..8e94f21c8e7 100644 --- a/js/xpconnect/src/XPCWrappedNativeScope.cpp +++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp @@ -570,18 +570,6 @@ XPCWrappedNativeScope::SystemIsBeingShutDown() // Now it is safe to kill all the scopes. KillDyingScopes(); - -#ifdef XPC_DUMP_AT_SHUTDOWN - if (data.wrapperCount) - printf("deleting nsXPConnect with %d live XPCWrappedNatives\n", - data.wrapperCount); - if (data.protoCount) - printf("deleting nsXPConnect with %d live XPCWrappedNativeProtos\n", - data.protoCount); - if (liveScopeCount) - printf("deleting nsXPConnect with %d live XPCWrappedNativeScopes\n", - liveScopeCount); -#endif } diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index c4ee929d896..ba6235a08c0 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -179,20 +179,9 @@ nsXPConnect::ReleaseXPConnectSingleton() } } } -#endif -#ifdef XPC_DUMP_AT_SHUTDOWN - // NOTE: to see really interesting stuff turn on the prlog stuff. - // See the comment at the top of XPCLog.h to see how to do that. - xpc->DebugDump(7); #endif nsrefcnt cnt; NS_RELEASE2(xpc, cnt); -#ifdef XPC_DUMP_AT_SHUTDOWN - if (0 != cnt) - printf("*** dangling reference to nsXPConnect: refcnt=%d\n", cnt); - else - printf("+++ XPConnect had no dangling references.\n"); -#endif } }