зеркало из https://github.com/mozilla/gecko-dev.git
Bug 937818, part 2 - Add js::ZoneGlobalsAreAllGray. r=jonco
If all globals in a zone are gray, then all live objects in that zone should also be gray.
This commit is contained in:
Родитель
76b4feac36
Коммит
56bc55bdfb
|
@ -647,6 +647,17 @@ js::AreGCGrayBitsValid(JSRuntime *rt)
|
|||
return rt->gcGrayBitsValid;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
js::ZoneGlobalsAreAllGray(JS::Zone *zone)
|
||||
{
|
||||
for (CompartmentsInZoneIter comp(zone); !comp.done(); comp.next()) {
|
||||
JSObject *obj = comp->maybeGlobal();
|
||||
if (!obj || !JS::GCThingIsMarkedGray(obj))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(JSGCTraceKind)
|
||||
js::GCThingTraceKind(void *thing)
|
||||
{
|
||||
|
|
|
@ -339,6 +339,9 @@ TraceWeakMaps(WeakMapTracer *trc);
|
|||
extern JS_FRIEND_API(bool)
|
||||
AreGCGrayBitsValid(JSRuntime *rt);
|
||||
|
||||
extern JS_FRIEND_API(bool)
|
||||
ZoneGlobalsAreAllGray(JS::Zone *zone);
|
||||
|
||||
typedef void
|
||||
(*GCThingCallback)(void *closure, void *gcthing);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче