зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1261106
) for frequent-yet-intermittent xpcshell failures in test_browserGlue_bookmarkshtml.js CLOSED TREE
Backed out changeset bbc385c27e0e (bug1261106
) Backed out changeset 07b0959c9c35 (bug1261106
)
This commit is contained in:
Родитель
d8c9a8cb2c
Коммит
a3ae137c11
|
@ -168,11 +168,8 @@ nsXPCWrappedJSClass::~nsXPCWrappedJSClass()
|
|||
{
|
||||
if (mDescriptors && mDescriptors != &zero_methods_descriptor)
|
||||
delete [] mDescriptors;
|
||||
|
||||
if (mRuntime) {
|
||||
if (auto map = mRuntime->GetWrappedJSClassMap())
|
||||
map->Remove(this);
|
||||
}
|
||||
if (mRuntime)
|
||||
mRuntime->GetWrappedJSClassMap()->Remove(this);
|
||||
|
||||
if (mName)
|
||||
free(mName);
|
||||
|
|
|
@ -433,50 +433,6 @@ mozilla::GetBuildId(JS::BuildIdCharVector* aBuildID)
|
|||
return true;
|
||||
}
|
||||
|
||||
struct ClearJSHolder : public TraceCallbacks
|
||||
{
|
||||
virtual void Trace(JS::Heap<JS::Value>* aPtr, const char*, void*) const override
|
||||
{
|
||||
aPtr->setUndefined();
|
||||
}
|
||||
|
||||
virtual void Trace(JS::Heap<jsid>* aPtr, const char*, void*) const override
|
||||
{
|
||||
*aPtr = JSID_VOID;
|
||||
}
|
||||
|
||||
virtual void Trace(JS::Heap<JSObject*>* aPtr, const char*, void*) const override
|
||||
{
|
||||
*aPtr = nullptr;
|
||||
}
|
||||
|
||||
virtual void Trace(JSObject** aPtr, const char* aName,
|
||||
void* aClosure) const override
|
||||
{
|
||||
*aPtr = nullptr;
|
||||
}
|
||||
|
||||
virtual void Trace(JS::TenuredHeap<JSObject*>* aPtr, const char*, void*) const override
|
||||
{
|
||||
*aPtr = nullptr;
|
||||
}
|
||||
|
||||
virtual void Trace(JS::Heap<JSString*>* aPtr, const char*, void*) const override
|
||||
{
|
||||
*aPtr = nullptr;
|
||||
}
|
||||
|
||||
virtual void Trace(JS::Heap<JSScript*>* aPtr, const char*, void*) const override
|
||||
{
|
||||
*aPtr = nullptr;
|
||||
}
|
||||
|
||||
virtual void Trace(JS::Heap<JSFunction*>* aPtr, const char*, void*) const override
|
||||
{
|
||||
*aPtr = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
CycleCollectedJSRuntime::CycleCollectedJSRuntime()
|
||||
: mGCThingCycleCollectorGlobal(sGCThingCycleCollectorGlobal)
|
||||
, mJSZoneCycleCollectorGlobal(sJSZoneCycleCollectorGlobal)
|
||||
|
@ -515,14 +471,6 @@ CycleCollectedJSRuntime::~CycleCollectedJSRuntime()
|
|||
MOZ_ASSERT(mDebuggerPromiseMicroTaskQueue.empty());
|
||||
MOZ_ASSERT(mPromiseMicroTaskQueue.empty());
|
||||
|
||||
for (auto iter = mJSHolders.Iter(); !iter.Done(); iter.Next()) {
|
||||
void* holder = iter.Key();
|
||||
nsScriptObjectTracer*& tracer = iter.Data();
|
||||
tracer->Trace(holder, ClearJSHolder(), nullptr);
|
||||
|
||||
}
|
||||
mJSHolders.Clear();
|
||||
|
||||
JS_DestroyRuntime(mJSRuntime);
|
||||
mJSRuntime = nullptr;
|
||||
nsCycleCollector_forgetJSRuntime();
|
||||
|
@ -1087,6 +1035,50 @@ CycleCollectedJSRuntime::AddJSHolder(void* aHolder, nsScriptObjectTracer* aTrace
|
|||
mJSHolders.Put(aHolder, aTracer);
|
||||
}
|
||||
|
||||
struct ClearJSHolder : public TraceCallbacks
|
||||
{
|
||||
virtual void Trace(JS::Heap<JS::Value>* aPtr, const char*, void*) const override
|
||||
{
|
||||
aPtr->setUndefined();
|
||||
}
|
||||
|
||||
virtual void Trace(JS::Heap<jsid>* aPtr, const char*, void*) const override
|
||||
{
|
||||
*aPtr = JSID_VOID;
|
||||
}
|
||||
|
||||
virtual void Trace(JS::Heap<JSObject*>* aPtr, const char*, void*) const override
|
||||
{
|
||||
*aPtr = nullptr;
|
||||
}
|
||||
|
||||
virtual void Trace(JSObject** aPtr, const char* aName,
|
||||
void* aClosure) const override
|
||||
{
|
||||
*aPtr = nullptr;
|
||||
}
|
||||
|
||||
virtual void Trace(JS::TenuredHeap<JSObject*>* aPtr, const char*, void*) const override
|
||||
{
|
||||
*aPtr = nullptr;
|
||||
}
|
||||
|
||||
virtual void Trace(JS::Heap<JSString*>* aPtr, const char*, void*) const override
|
||||
{
|
||||
*aPtr = nullptr;
|
||||
}
|
||||
|
||||
virtual void Trace(JS::Heap<JSScript*>* aPtr, const char*, void*) const override
|
||||
{
|
||||
*aPtr = nullptr;
|
||||
}
|
||||
|
||||
virtual void Trace(JS::Heap<JSFunction*>* aPtr, const char*, void*) const override
|
||||
{
|
||||
*aPtr = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
void
|
||||
CycleCollectedJSRuntime::RemoveJSHolder(void* aHolder)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче