зеркало из https://github.com/mozilla/gecko-dev.git
Bug 845545: Part 1 - Fix heap dumping to work off the main thread. r=mccr8
This commit is contained in:
Родитель
1e0d44226f
Коммит
92d60a1477
|
@ -1445,14 +1445,6 @@ Base64Decode(JSContext *cx, JS::Value val, JS::Value *out)
|
|||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
DumpJSHeap(FILE* file)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Must dump GC heap on main thread.");
|
||||
nsXPConnect* xpc = nsXPConnect::XPConnect();
|
||||
js::DumpHeapComplete(xpc->GetRuntime()->Runtime(), file);
|
||||
}
|
||||
|
||||
void
|
||||
SetLocationForGlobal(JSObject *global, const nsACString& location)
|
||||
{
|
||||
|
|
|
@ -321,8 +321,6 @@ nsIPrincipal *GetObjectPrincipal(JSObject *obj);
|
|||
|
||||
bool IsXBLScope(JSCompartment *compartment);
|
||||
|
||||
void DumpJSHeap(FILE* file);
|
||||
|
||||
void SetLocationForGlobal(JSObject *global, const nsACString& location);
|
||||
void SetLocationForGlobal(JSObject *global, nsIURI *locationURI);
|
||||
|
||||
|
|
|
@ -1032,6 +1032,13 @@ CycleCollectedJSRuntime::DeferredFinalize(nsISupports* aSupports)
|
|||
mDeferredSupports.AppendElement(aSupports);
|
||||
}
|
||||
|
||||
void
|
||||
CycleCollectedJSRuntime::DumpJSHeap(FILE* file)
|
||||
{
|
||||
js::DumpHeapComplete(Runtime(), file);
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
ReleaseSliceNow(uint32_t aSlice, void* aData)
|
||||
{
|
||||
|
|
|
@ -196,6 +196,8 @@ public:
|
|||
void* aThing);
|
||||
void DeferredFinalize(nsISupports* aSupports);
|
||||
|
||||
void DumpJSHeap(FILE* aFile);
|
||||
|
||||
private:
|
||||
JSGCThingParticipant mGCThingCycleCollectorGlobal;
|
||||
|
||||
|
|
|
@ -1447,7 +1447,9 @@ public:
|
|||
gcLogFile->OpenANSIFileDesc("w", &gcLogANSIFile);
|
||||
NS_ENSURE_STATE(gcLogANSIFile);
|
||||
MozillaRegisterDebugFILE(gcLogANSIFile);
|
||||
xpc::DumpJSHeap(gcLogANSIFile);
|
||||
CollectorData *data = sCollectorData.get();
|
||||
if (data && data->mRuntime)
|
||||
data->mRuntime->DumpJSHeap(gcLogANSIFile);
|
||||
MozillaUnRegisterDebugFILE(gcLogANSIFile);
|
||||
fclose(gcLogANSIFile);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче