bool RootList::init(ZoneSet &debuggees) { SimpleEdgeVector allRootEdges(cx); SimpleEdgeVectorTracer tracer(cx, &allRootEdges, wantNames); JS_TraceRuntime(&tracer); if (!tracer.okay) return false; JS_TraceIncomingCCWs(&tracer, debuggees); if (!tracer.okay) return false; for (SimpleEdgeVector::Range r = allRootEdges.all(); !r.empty(); r.popFront()) { SimpleEdge &edge = r.front(); Zone *zone = edge.referent.zone(); if (zone && !debuggees.has(zone)) continue; if (!edges.append(mozilla::Move(edge))) return false; } noGC.emplace(cx->runtime()); return true; }
bool RootList::init(CompartmentSet& debuggees) { EdgeVector allRootEdges; EdgeVectorTracer tracer(rt, &allRootEdges, wantNames); ZoneSet debuggeeZones; if (!debuggeeZones.init()) return false; for (auto range = debuggees.all(); !range.empty(); range.popFront()) { if (!debuggeeZones.put(range.front()->zone())) return false; } js::TraceRuntime(&tracer); if (!tracer.okay) return false; TraceIncomingCCWs(&tracer, debuggees); if (!tracer.okay) return false; for (EdgeVector::Range r = allRootEdges.all(); !r.empty(); r.popFront()) { Edge& edge = r.front(); JSCompartment* compartment = edge.referent.compartment(); if (compartment && !debuggees.has(compartment)) continue; Zone* zone = edge.referent.zone(); if (zone && !debuggeeZones.has(zone)) continue; if (!edges.append(mozilla::Move(edge))) return false; } noGC.emplace(rt); return true; }