Ejemplo n.º 1
0
    MinorCollectionTracer(JSRuntime *rt, Nursery *nursery)
      : JSTracer(),
        nursery(nursery),
        runtime(rt),
        session(runtime, MinorCollecting),
        head(NULL),
        tail(&head),
        savedNeedsBarrier(runtime->needsBarrier()),
        disableStrictProxyChecking(runtime)
    {
        JS_TracerInit(this, runtime, Nursery::MinorGCCallback);
        eagerlyTraceWeakMaps = TraceWeakMapKeysValues;

        runtime->gcNumber++;
        runtime->setNeedsBarrier(false);
        for (ZonesIter zone(rt); !zone.done(); zone.next())
            zone->saveNeedsBarrier(false);
    }
Ejemplo n.º 2
0
 ~MinorCollectionTracer() {
     runtime->setNeedsBarrier(savedNeedsBarrier);
     for (ZonesIter zone(runtime); !zone.done(); zone.next())
         zone->restoreNeedsBarrier();
 }