зеркало из https://github.com/mozilla/gecko-dev.git
Bug 641910. Don't add non-grey nodes to the cycle collector model graph. r=gal@uci.edu
This commit is contained in:
Родитель
7ce7a4f93d
Коммит
8a822b4e90
|
@ -727,7 +727,8 @@ nsXPConnect::Traverse(void *p, nsCycleCollectionTraversalCallback &cb)
|
|||
#endif
|
||||
{
|
||||
// Normal codepath (matches non-DEBUG_CC codepath).
|
||||
type = !markJSObject && xpc_IsGrayGCThing(p) ? GCUnmarked : GCMarked;
|
||||
NS_ASSERTION(xpc_IsGrayGCThing(p), "Tried to traverse a non-gray object.");
|
||||
type = markJSObject ? GCMarked : GCUnmarked;
|
||||
}
|
||||
|
||||
if (cb.WantDebugInfo()) {
|
||||
|
|
|
@ -150,6 +150,7 @@
|
|||
#include "nsICycleCollectorListener.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsIJSRuntimeService.h"
|
||||
#include "xpcpublic.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -1672,6 +1673,13 @@ GCGraphBuilder::NoteScriptChild(PRUint32 langID, void *child)
|
|||
return;
|
||||
}
|
||||
|
||||
// skip over non-grey JS children
|
||||
if (langID == nsIProgrammingLanguage::JAVASCRIPT) {
|
||||
JSObject *obj = static_cast<JSObject*>(child);
|
||||
if (!xpc_IsGrayGCThing(obj) && !WantAllTraces())
|
||||
return;
|
||||
}
|
||||
|
||||
nsCycleCollectionParticipant *cp = mRuntimes[langID]->ToParticipant(child);
|
||||
if (!cp)
|
||||
return;
|
||||
|
|
Загрузка…
Ссылка в новой задаче