Bug 937157, part 8 - Remove XPC_TRACK_SCOPE_STATS. r=bholley

This commit is contained in:
Andrew McCreight 2013-11-17 14:47:00 -08:00
parent 4d2c0de390
commit b77d413d8f
2 changed files with 0 additions and 73 deletions

View File

@ -20,67 +20,6 @@ using namespace JS;
/***************************************************************************/
#ifdef XPC_TRACK_SCOPE_STATS
static int DEBUG_TotalScopeCount;
static int DEBUG_TotalLiveScopeCount;
static int DEBUG_TotalMaxScopeCount;
static int DEBUG_TotalScopeTraversalCount;
static bool DEBUG_DumpedStats;
#endif
#ifdef DEBUG
static void DEBUG_TrackNewScope(XPCWrappedNativeScope* scope)
{
#ifdef XPC_TRACK_SCOPE_STATS
DEBUG_TotalScopeCount++;
DEBUG_TotalLiveScopeCount++;
if (DEBUG_TotalMaxScopeCount < DEBUG_TotalLiveScopeCount)
DEBUG_TotalMaxScopeCount = DEBUG_TotalLiveScopeCount;
#endif
}
static void DEBUG_TrackDeleteScope(XPCWrappedNativeScope* scope)
{
#ifdef XPC_TRACK_SCOPE_STATS
DEBUG_TotalLiveScopeCount--;
#endif
}
static void DEBUG_TrackScopeTraversal()
{
#ifdef XPC_TRACK_SCOPE_STATS
DEBUG_TotalScopeTraversalCount++;
#endif
}
static void DEBUG_TrackScopeShutdown()
{
#ifdef XPC_TRACK_SCOPE_STATS
if (!DEBUG_DumpedStats) {
DEBUG_DumpedStats = true;
printf("%d XPCWrappedNativeScope(s) were constructed.\n",
DEBUG_TotalScopeCount);
printf("%d XPCWrappedNativeScopes(s) max alive at one time.\n",
DEBUG_TotalMaxScopeCount);
printf("%d XPCWrappedNativeScope(s) alive now.\n" ,
DEBUG_TotalLiveScopeCount);
printf("%d traversals of Scope list.\n",
DEBUG_TotalScopeTraversalCount);
}
#endif
}
#else
#define DEBUG_TrackNewScope(scope) ((void)0)
#define DEBUG_TrackDeleteScope(scope) ((void)0)
#define DEBUG_TrackScopeTraversal() ((void)0)
#define DEBUG_TrackScopeShutdown() ((void)0)
#endif
/***************************************************************************/
XPCWrappedNativeScope* XPCWrappedNativeScope::gScopes = nullptr;
XPCWrappedNativeScope* XPCWrappedNativeScope::gDyingScopes = nullptr;
@ -156,7 +95,6 @@ XPCWrappedNativeScope::XPCWrappedNativeScope(JSContext *cx,
mContext->AddScope(this);
}
DEBUG_TrackNewScope(this);
MOZ_COUNT_CTOR(XPCWrappedNativeScope);
// Attach ourselves to the compartment private.
@ -310,7 +248,6 @@ bool UseXBLScope(JSCompartment *c)
XPCWrappedNativeScope::~XPCWrappedNativeScope()
{
MOZ_COUNT_DTOR(XPCWrappedNativeScope);
DEBUG_TrackDeleteScope(this);
// We can do additional cleanup assertions here...
@ -495,8 +432,6 @@ XPCWrappedNativeScope::MarkAllWrappedNativesAndProtos()
cur->mWrappedNativeProtoMap->Enumerate(WrappedNativeProtoMarker, nullptr);
cur->mMainThreadWrappedNativeProtoMap->Enumerate(WrappedNativeProtoMarker, nullptr);
}
DEBUG_TrackScopeTraversal();
}
#ifdef DEBUG
@ -542,8 +477,6 @@ XPCWrappedNativeScope::SweepAllWrappedNativeTearOffs()
{
for (XPCWrappedNativeScope* cur = gScopes; cur; cur = cur->mNext)
cur->mWrappedNativeMap->Enumerate(WrappedNativeTearoffSweeper, nullptr);
DEBUG_TrackScopeTraversal();
}
// static
@ -598,9 +531,6 @@ WrappedNativeProtoShutdownEnumerator(PLDHashTable *table, PLDHashEntryHdr *hdr,
void
XPCWrappedNativeScope::SystemIsBeingShutDown()
{
DEBUG_TrackScopeTraversal();
DEBUG_TrackScopeShutdown();
int liveScopeCount = 0;
ShutdownData data;
@ -679,8 +609,6 @@ XPCWrappedNativeScope::ClearAllWrappedNativeSecurityPolicies()
cur->mMainThreadWrappedNativeProtoMap->Enumerate(WNProtoSecPolicyClearer, nullptr);
}
DEBUG_TrackScopeTraversal();
return NS_OK;
}

View File

@ -181,7 +181,6 @@
#if defined(DEBUG_xpc_hacker)
#define XPC_DUMP_AT_SHUTDOWN
#define XPC_TRACK_WRAPPER_STATS
#define XPC_TRACK_SCOPE_STATS
#endif
/***************************************************************************/