Ignore:
Timestamp:
Aug 26, 2012, 8:57:02 PM (13 years ago)
Author:
[email protected]
Message:

Removed the NULL checks from visitChildren functions
https://bugs.webkit.org/show_bug.cgi?id=95021

Reviewed by Oliver Hunt.

Source/JavaScriptCore:

As of http://trac.webkit.org/changeset/126624, all values are NULL-checked
during GC, so explicit NULL checks aren't needed anymore.

Source/WebCore:

As of http://trac.webkit.org/changeset/126624, all values are NULL-checked
during GC, so explicit NULL checks aren't needed anymore.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/Structure.cpp

    r123052 r126721  
    763763    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
    764764    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     765
    765766    JSCell::visitChildren(thisObject, visitor);
    766     if (thisObject->m_globalObject)
    767         visitor.append(&thisObject->m_globalObject);
     767    visitor.append(&thisObject->m_globalObject);
    768768    if (!thisObject->isObject())
    769769        thisObject->m_cachedPrototypeChain.clear();
    770770    else {
    771         if (thisObject->m_prototype)
    772             visitor.append(&thisObject->m_prototype);
    773         if (thisObject->m_cachedPrototypeChain)
    774             visitor.append(&thisObject->m_cachedPrototypeChain);
    775     }
    776     if (thisObject->m_previous)
    777         visitor.append(&thisObject->m_previous);
    778     if (thisObject->m_specificValueInPrevious)
    779         visitor.append(&thisObject->m_specificValueInPrevious);
    780     if (thisObject->m_enumerationCache)
    781         visitor.append(&thisObject->m_enumerationCache);
     771        visitor.append(&thisObject->m_prototype);
     772        visitor.append(&thisObject->m_cachedPrototypeChain);
     773    }
     774    visitor.append(&thisObject->m_previous);
     775    visitor.append(&thisObject->m_specificValueInPrevious);
     776    visitor.append(&thisObject->m_enumerationCache);
    782777    if (thisObject->m_propertyTable) {
    783778        PropertyTable::iterator end = thisObject->m_propertyTable->end();
    784         for (PropertyTable::iterator ptr = thisObject->m_propertyTable->begin(); ptr != end; ++ptr) {
    785             if (ptr->specificValue)
    786                 visitor.append(&ptr->specificValue);
    787         }
    788     }
    789     if (thisObject->m_objectToStringValue)
    790         visitor.append(&thisObject->m_objectToStringValue);
     779        for (PropertyTable::iterator ptr = thisObject->m_propertyTable->begin(); ptr != end; ++ptr)
     780            visitor.append(&ptr->specificValue);
     781    }
     782    visitor.append(&thisObject->m_objectToStringValue);
    791783}
    792784
Note: See TracChangeset for help on using the changeset viewer.