mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1283855
part 17 - Make {Get,Set}DebuggerMallocSizeOf take JSContext instead of JSRuntime. r=jimb
This commit is contained in:
parent
c1ed92b71b
commit
79865aba2a
@ -63,9 +63,9 @@ GetCurrentThreadDebuggerMallocSizeOf()
|
||||
{
|
||||
auto ccrt = CycleCollectedJSRuntime::Get();
|
||||
MOZ_ASSERT(ccrt);
|
||||
auto rt = ccrt->Runtime();
|
||||
MOZ_ASSERT(rt);
|
||||
auto mallocSizeOf = JS::dbg::GetDebuggerMallocSizeOf(rt);
|
||||
auto cx = ccrt->Context();
|
||||
MOZ_ASSERT(cx);
|
||||
auto mallocSizeOf = JS::dbg::GetDebuggerMallocSizeOf(cx);
|
||||
MOZ_ASSERT(mallocSizeOf);
|
||||
return mallocSizeOf;
|
||||
}
|
||||
@ -1246,8 +1246,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
JSRuntime* rt = JS_GetRuntime(cx);
|
||||
mozilla::MallocSizeOf mallocSizeOf = dbg::GetDebuggerMallocSizeOf(rt);
|
||||
mozilla::MallocSizeOf mallocSizeOf = dbg::GetDebuggerMallocSizeOf(cx);
|
||||
MOZ_ASSERT(mallocSizeOf);
|
||||
protobufNode.set_size(ubiNode.size(mallocSizeOf));
|
||||
|
||||
|
@ -257,15 +257,15 @@ class BuilderOrigin : public Builder {
|
||||
// and returns the number of bytes allocated to that block. SpiderMonkey itself
|
||||
// doesn't know which function is appropriate to use, but the embedding does.
|
||||
|
||||
// Tell Debuggers in |runtime| to use |mallocSizeOf| to find the size of
|
||||
// Tell Debuggers in |cx| to use |mallocSizeOf| to find the size of
|
||||
// malloc'd blocks.
|
||||
JS_PUBLIC_API(void)
|
||||
SetDebuggerMallocSizeOf(JSRuntime* runtime, mozilla::MallocSizeOf mallocSizeOf);
|
||||
SetDebuggerMallocSizeOf(JSContext* cx, mozilla::MallocSizeOf mallocSizeOf);
|
||||
|
||||
// Get the MallocSizeOf function that the given runtime is using to find the
|
||||
// Get the MallocSizeOf function that the given context is using to find the
|
||||
// size of malloc'd blocks.
|
||||
JS_PUBLIC_API(mozilla::MallocSizeOf)
|
||||
GetDebuggerMallocSizeOf(JSRuntime* runtime);
|
||||
GetDebuggerMallocSizeOf(JSContext* cx);
|
||||
|
||||
|
||||
|
||||
|
@ -7405,7 +7405,7 @@ main(int argc, char** argv, char** envp)
|
||||
|
||||
JS_SetNativeStackQuota(cx, gMaxStackSize);
|
||||
|
||||
JS::dbg::SetDebuggerMallocSizeOf(rt, moz_malloc_size_of);
|
||||
JS::dbg::SetDebuggerMallocSizeOf(cx, moz_malloc_size_of);
|
||||
|
||||
if (!JS::InitSelfHostedCode(cx))
|
||||
return 1;
|
||||
|
@ -355,15 +355,15 @@ DebuggerMemory::setOnGarbageCollection(JSContext* cx, unsigned argc, Value* vp)
|
||||
/* Debugger.Memory.prototype.takeCensus */
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS::dbg::SetDebuggerMallocSizeOf(JSRuntime* rt, mozilla::MallocSizeOf mallocSizeOf)
|
||||
JS::dbg::SetDebuggerMallocSizeOf(JSContext* cx, mozilla::MallocSizeOf mallocSizeOf)
|
||||
{
|
||||
rt->debuggerMallocSizeOf = mallocSizeOf;
|
||||
cx->debuggerMallocSizeOf = mallocSizeOf;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(mozilla::MallocSizeOf)
|
||||
JS::dbg::GetDebuggerMallocSizeOf(JSRuntime* rt)
|
||||
JS::dbg::GetDebuggerMallocSizeOf(JSContext* cx)
|
||||
{
|
||||
return rt->debuggerMallocSizeOf;
|
||||
return cx->debuggerMallocSizeOf;
|
||||
}
|
||||
|
||||
using JS::ubi::Census;
|
||||
|
@ -556,7 +556,7 @@ CycleCollectedJSRuntime::Initialize(JSRuntime* aParentRuntime,
|
||||
mConsumedRejections.init(mJSRuntime, JS::GCVector<JSObject*, 0, js::SystemAllocPolicy>(js::SystemAllocPolicy()));
|
||||
#endif // SPIDERMONKEY_PROMISE
|
||||
|
||||
JS::dbg::SetDebuggerMallocSizeOf(mJSRuntime, moz_malloc_size_of);
|
||||
JS::dbg::SetDebuggerMallocSizeOf(mJSContext, moz_malloc_size_of);
|
||||
|
||||
nsCycleCollector_registerJSRuntime(this);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user