Пример #1
0
void
js::IterateGrayObjects(Zone* zone, GCThingCallback cellCallback, void* data)
{
    JSRuntime* rt = zone->runtimeFromMainThread();
    MOZ_ASSERT(!rt->isHeapBusy());
    AutoPrepareForTracing prep(rt->contextFromMainThread(), SkipAtoms);
    ::IterateGrayObjects(zone, cellCallback, data);
}
Пример #2
0
void
js::TraceRuntime(JSTracer* trc)
{
    MOZ_ASSERT(!trc->isMarkingTracer());

    JSRuntime* rt = trc->runtime();
    rt->gc.evictNursery();
    AutoPrepareForTracing prep(rt->contextFromMainThread(), WithAtoms);
    gcstats::AutoPhase ap(rt->gc.stats, gcstats::PHASE_TRACE_HEAP);
    rt->gc.markRuntime(trc, GCRuntime::TraceRuntime, prep.session().lock);
}
Пример #3
0
void
js::IterateGrayObjects(Zone* zone, GCThingCallback cellCallback, void* data)
{
    JSRuntime* rt = zone->runtimeFromMainThread();
    AutoEmptyNursery empty(rt);
    AutoPrepareForTracing prep(rt->contextFromMainThread(), SkipAtoms);

    for (auto thingKind : ObjectAllocKinds()) {
        for (auto obj = zone->cellIter<JSObject>(thingKind, empty); !obj.done(); obj.next()) {
            if (obj->asTenured().isMarked(GRAY))
                cellCallback(data, JS::GCCellPtr(obj.get()));
        }
    }
}