mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
4b4868e59c
commit
887ed3eb3d
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user