Bug 1283855 part 24 - Make js::DumpHeap take JSContext instead of JSRuntime. r=sfink
This commit is contained in:
@@ -1522,7 +1522,7 @@ DumpHeap(JSContext* cx, unsigned argc, Value* vp)
|
||||
return false;
|
||||
}
|
||||
|
||||
js::DumpHeap(JS_GetRuntime(cx), dumpFile ? dumpFile : stdout, nurseryBehaviour);
|
||||
js::DumpHeap(cx, dumpFile ? dumpFile : stdout, nurseryBehaviour);
|
||||
|
||||
if (dumpFile)
|
||||
fclose(dumpFile);
|
||||
|
||||
@@ -1109,12 +1109,12 @@ DumpHeapTracer::onChild(const JS::GCCellPtr& thing)
|
||||
}
|
||||
|
||||
void
|
||||
js::DumpHeap(JSRuntime* rt, FILE* fp, js::DumpHeapNurseryBehaviour nurseryBehaviour)
|
||||
js::DumpHeap(JSContext* cx, FILE* fp, js::DumpHeapNurseryBehaviour nurseryBehaviour)
|
||||
{
|
||||
if (nurseryBehaviour == js::CollectNurseryBeforeDump)
|
||||
rt->gc.evictNursery(JS::gcreason::API);
|
||||
cx->gc.evictNursery(JS::gcreason::API);
|
||||
|
||||
DumpHeapTracer dtrc(fp, rt);
|
||||
DumpHeapTracer dtrc(fp, cx);
|
||||
fprintf(dtrc.output, "# Roots.\n");
|
||||
TraceRuntime(&dtrc);
|
||||
|
||||
@@ -1124,7 +1124,7 @@ js::DumpHeap(JSRuntime* rt, FILE* fp, js::DumpHeapNurseryBehaviour nurseryBehavi
|
||||
fprintf(dtrc.output, "==========\n");
|
||||
|
||||
dtrc.prefix = "> ";
|
||||
IterateZonesCompartmentsArenasCells(rt, &dtrc,
|
||||
IterateZonesCompartmentsArenasCells(cx, &dtrc,
|
||||
DumpHeapVisitZone,
|
||||
DumpHeapVisitCompartment,
|
||||
DumpHeapVisitArena,
|
||||
|
||||
@@ -474,7 +474,7 @@ typedef enum {
|
||||
* fp is the file for the dump output.
|
||||
*/
|
||||
extern JS_FRIEND_API(void)
|
||||
DumpHeap(JSRuntime* rt, FILE* fp, DumpHeapNurseryBehaviour nurseryBehaviour);
|
||||
DumpHeap(JSContext* cx, FILE* fp, DumpHeapNurseryBehaviour nurseryBehaviour);
|
||||
|
||||
#ifdef JS_OLD_GETTER_SETTER_METHODS
|
||||
JS_FRIEND_API(bool) obj_defineGetter(JSContext* cx, unsigned argc, JS::Value* vp);
|
||||
|
||||
@@ -1325,8 +1325,7 @@ CycleCollectedJSRuntime::DeferredFinalize(nsISupports* aSupports)
|
||||
void
|
||||
CycleCollectedJSRuntime::DumpJSHeap(FILE* aFile)
|
||||
{
|
||||
MOZ_ASSERT(mJSRuntime);
|
||||
js::DumpHeap(Runtime(), aFile, js::CollectNurseryBeforeDump);
|
||||
js::DumpHeap(Context(), aFile, js::CollectNurseryBeforeDump);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user