mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Bug 853228 - Remove unused functions in jsdbgapi (r=luke)
This commit is contained in:
parent
c0f4912a27
commit
3f42a949f7
@ -830,89 +830,6 @@ JS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure)
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
JS_PUBLIC_API(size_t)
|
||||
JS_GetObjectTotalSize(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
return obj->computedSizeOfThisSlotsElements();
|
||||
}
|
||||
|
||||
static size_t
|
||||
GetAtomTotalSize(JSContext *cx, JSAtom *atom)
|
||||
{
|
||||
return sizeof(AtomStateEntry) + sizeof(HashNumber) +
|
||||
sizeof(JSString) +
|
||||
(atom->length() + 1) * sizeof(jschar);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(size_t)
|
||||
JS_GetFunctionTotalSize(JSContext *cx, JSFunction *fun)
|
||||
{
|
||||
size_t nbytes = sizeof *fun;
|
||||
nbytes += JS_GetObjectTotalSize(cx, fun);
|
||||
if (fun->isInterpreted())
|
||||
nbytes += JS_GetScriptTotalSize(cx, fun->nonLazyScript());
|
||||
if (fun->displayAtom())
|
||||
nbytes += GetAtomTotalSize(cx, fun->displayAtom());
|
||||
return nbytes;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(size_t)
|
||||
JS_GetScriptTotalSize(JSContext *cx, JSScript *script)
|
||||
{
|
||||
size_t nbytes, pbytes;
|
||||
jssrcnote *sn, *notes;
|
||||
ObjectArray *objarray;
|
||||
JSPrincipals *principals;
|
||||
|
||||
nbytes = sizeof *script;
|
||||
nbytes += script->length * sizeof script->code[0];
|
||||
nbytes += script->natoms * sizeof script->atoms[0];
|
||||
for (size_t i = 0; i < script->natoms; i++)
|
||||
nbytes += GetAtomTotalSize(cx, script->atoms[i]);
|
||||
|
||||
if (script->filename())
|
||||
nbytes += strlen(script->filename()) + 1;
|
||||
|
||||
notes = script->notes();
|
||||
for (sn = notes; !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn))
|
||||
continue;
|
||||
nbytes += (sn - notes + 1) * sizeof *sn;
|
||||
|
||||
if (script->hasObjects()) {
|
||||
objarray = script->objects();
|
||||
size_t i = objarray->length;
|
||||
nbytes += sizeof *objarray + i * sizeof objarray->vector[0];
|
||||
do {
|
||||
nbytes += JS_GetObjectTotalSize(cx, objarray->vector[--i]);
|
||||
} while (i != 0);
|
||||
}
|
||||
|
||||
if (script->hasRegexps()) {
|
||||
objarray = script->regexps();
|
||||
size_t i = objarray->length;
|
||||
nbytes += sizeof *objarray + i * sizeof objarray->vector[0];
|
||||
do {
|
||||
nbytes += JS_GetObjectTotalSize(cx, objarray->vector[--i]);
|
||||
} while (i != 0);
|
||||
}
|
||||
|
||||
if (script->hasTrynotes())
|
||||
nbytes += sizeof(TryNoteArray) + script->trynotes()->length * sizeof(JSTryNote);
|
||||
|
||||
principals = script->principals();
|
||||
if (principals) {
|
||||
JS_ASSERT(principals->refcount);
|
||||
pbytes = sizeof *principals;
|
||||
if (principals->refcount > 1)
|
||||
pbytes = JS_HOWMANY(pbytes, principals->refcount);
|
||||
nbytes += pbytes;
|
||||
}
|
||||
|
||||
return nbytes;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
JS_FRIEND_API(void)
|
||||
js_RevertVersion(JSContext *cx)
|
||||
{
|
||||
|
@ -431,17 +431,6 @@ JS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure);
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
extern JS_PUBLIC_API(size_t)
|
||||
JS_GetObjectTotalSize(JSContext *cx, JSObject *obj);
|
||||
|
||||
extern JS_PUBLIC_API(size_t)
|
||||
JS_GetFunctionTotalSize(JSContext *cx, JSFunction *fun);
|
||||
|
||||
extern JS_PUBLIC_API(size_t)
|
||||
JS_GetScriptTotalSize(JSContext *cx, JSScript *script);
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
extern JS_FRIEND_API(void)
|
||||
js_RevertVersion(JSContext *cx);
|
||||
|
||||
|
@ -387,8 +387,6 @@ class JSObject : public js::ObjectImpl
|
||||
|
||||
inline bool hasShapeTable() const;
|
||||
|
||||
inline size_t computedSizeOfThisSlotsElements() const;
|
||||
|
||||
inline void sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf, JS::ObjectsExtraSizes *sizes);
|
||||
|
||||
bool hasIdempotentProtoChain() const;
|
||||
|
@ -1082,26 +1082,6 @@ JSObject::hasShapeTable() const
|
||||
return lastProperty()->hasTable();
|
||||
}
|
||||
|
||||
inline size_t
|
||||
JSObject::computedSizeOfThisSlotsElements() const
|
||||
{
|
||||
size_t n = sizeOfThis();
|
||||
|
||||
if (hasDynamicSlots())
|
||||
n += numDynamicSlots() * sizeof(js::Value);
|
||||
|
||||
if (hasDynamicElements()) {
|
||||
if (isArrayBuffer()) {
|
||||
n += getElementsHeader()->initializedLength;
|
||||
} else {
|
||||
n += (js::ObjectElements::VALUES_PER_HEADER + getElementsHeader()->capacity) *
|
||||
sizeof(js::Value);
|
||||
}
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
inline void
|
||||
JSObject::sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf, JS::ObjectsExtraSizes *sizes)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user