Bug 648490 - Remove the "heap-used/js/string-data" memory reporter because it is totally bogus. r=gal.

This commit is contained in:
Nicholas Nethercote 2011-05-11 16:09:50 -07:00
parent c398e4b84b
commit d258fef2cf
5 changed files with 3 additions and 23 deletions

View File

@ -705,7 +705,6 @@ struct JSRuntime {
/* This measures the size of JITScripts, native maps and IC structs. */
size_t mjitDataSize;
#endif
size_t stringMemoryUsed;
JSRuntime();
~JSRuntime();

View File

@ -283,9 +283,6 @@ JSRope::flatten(JSContext *maybecx)
if (!wholeChars)
return NULL;
if (maybecx)
maybecx->runtime->stringMemoryUsed += wholeLength * 2;
pos = wholeChars;
first_visit_node: {
JSString &left = *str->d.u1.left;
@ -390,8 +387,6 @@ JSDependentString::undepend(JSContext *cx)
if (!s)
return NULL;
cx->runtime->stringMemoryUsed += size;
PodCopy(s, chars(), n);
s[n] = 0;

View File

@ -332,7 +332,6 @@ JSFixedString::new_(JSContext *cx, const jschar *chars, size_t length)
return NULL;
str->init(chars, length);
cx->runtime->stringMemoryUsed += length * 2;
#ifdef DEBUG
JSRuntime *rt = cx->runtime;
JS_RUNTIME_METER(rt, liveStrings);
@ -530,7 +529,6 @@ inline void
JSFlatString::finalize(JSRuntime *rt)
{
JS_ASSERT(!isShort());
rt->stringMemoryUsed -= length() * 2;
/*
* This check depends on the fact that 'chars' is only initialized to the

View File

@ -4659,7 +4659,9 @@ MJitDataStats(JSContext *cx, uintN argc, jsval *vp)
JSBool
StringStats(JSContext *cx, uintN argc, jsval *vp)
{
JS_SET_RVAL(cx, vp, INT_TO_JSVAL(cx->runtime->stringMemoryUsed));
// XXX: should report something meaningful; bug 625305 will probably fix
// this.
JS_SET_RVAL(cx, vp, INT_TO_JSVAL(0));
return true;
}

View File

@ -1401,19 +1401,6 @@ NS_MEMORY_REPORTER_IMPLEMENT(XPConnectJSTjitDataAllocatorsReserve,
NULL)
#endif // JS_TRACER
static PRInt64
GetJSStringData(void *data)
{
JSRuntime *rt = nsXPConnect::GetRuntimeInstance()->GetJSRuntime();
return rt->stringMemoryUsed;
}
NS_MEMORY_REPORTER_IMPLEMENT(XPConnectJSStringData,
"heap-used/js/string-data",
"Memory allocated for JavaScript string data.",
GetJSStringData,
NULL)
XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
: mXPConnect(aXPConnect),
mJSRuntime(nsnull),
@ -1480,7 +1467,6 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
mJSRuntime->setCustomGCChunkAllocator(&gXPCJSChunkAllocator);
NS_RegisterMemoryReporter(new NS_MEMORY_REPORTER_NAME(XPConnectJSGCHeap));
NS_RegisterMemoryReporter(new NS_MEMORY_REPORTER_NAME(XPConnectJSStringData));
#ifdef JS_METHODJIT
NS_RegisterMemoryReporter(new NS_MEMORY_REPORTER_NAME(XPConnectJSMjitCode));
NS_RegisterMemoryReporter(new NS_MEMORY_REPORTER_NAME(XPConnectJSMjitData));