Ejemplo n.º 1
0
void SymbolTable::visitChildren(JSCell* thisCell, SlotVisitor& visitor)
{
    SymbolTable* thisSymbolTable = jsCast<SymbolTable*>(thisCell);
    if (!thisSymbolTable->m_watchpointCleanup) {
        thisSymbolTable->m_watchpointCleanup =
            std::make_unique<WatchpointCleanup>(thisSymbolTable);
    }
    
    visitor.addUnconditionalFinalizer(thisSymbolTable->m_watchpointCleanup.get());
}
Ejemplo n.º 2
0
void WeakMapData::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
    Base::visitChildren(cell, visitor);
    WeakMapData* thisObj = jsCast<WeakMapData*>(cell);
    visitor.addUnconditionalFinalizer(&thisObj->m_deadKeyCleaner);
    visitor.addWeakReferenceHarvester(&thisObj->m_deadKeyCleaner);

    // Rough approximation of the external storage needed for the hashtable.
    // This isn't exact, but it is close enough, and proportional to the actual
    // external mermory usage.
    visitor.reportExtraMemoryUsage(thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier<Unknown>)));
}
Ejemplo n.º 3
0
void InferredType::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
    InferredType* inferredType = jsCast<InferredType*>(cell);
    
    ConcurrentJSLocker locker(inferredType->m_lock);

    if (inferredType->m_structure) {
        // The mutator may clear the structure before the GC runs finalizers, so we have to protect
        // the finalizer from being destroyed.
        inferredType->m_structure->ref();
        visitor.addUnconditionalFinalizer(&inferredType->m_structure->m_finalizer);
    }
}