Ignore:
Timestamp:
Oct 16, 2009, 7:31:42 PM (16 years ago)
Author:
[email protected]
Message:

Roll out r49717 as it broke the build.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSPropertyNameIterator.cpp

    r49717 r49726  
    3030#include "JSPropertyNameIterator.h"
    3131
    32 #include "JSGlobalObject.h"
    33 
    3432namespace JSC {
    3533
    3634ASSERT_CLASS_FITS_IN_CELL(JSPropertyNameIterator);
    3735
    38 JSPropertyNameIterator* JSPropertyNameIterator::create(ExecState* exec, JSObject* o)
     36JSPropertyNameIterator::~JSPropertyNameIterator()
    3937{
    40     ASSERT(!o->structure()->enumerationCache() ||
    41             o->structure()->enumerationCache()->cachedStructure() != o->structure() ||
    42             o->structure()->enumerationCache()->cachedPrototypeChain() != o->structure()->prototypeChain(exec));
    43 
    44     PropertyNameArray propertyNames(exec);
    45     o->getPropertyNames(exec, propertyNames);
    46     JSPropertyNameIterator* jsPropertyNameIterator = new (exec) JSPropertyNameIterator(exec, propertyNames.data());
    47 
    48     if (o->structure()->isDictionary())
    49         return jsPropertyNameIterator;
    50 
    51     if (o->structure()->typeInfo().overridesGetPropertyNames())
    52         return jsPropertyNameIterator;
    53    
    54     size_t count = normalizePrototypeChain(exec, o);
    55     StructureChain* structureChain = o->structure()->prototypeChain(exec);
    56     RefPtr<Structure>* structure = structureChain->head();
    57     for (size_t i = 0; i < count; ++i) {
    58         if (structure[i]->typeInfo().overridesGetPropertyNames())
    59             return jsPropertyNameIterator;
    60     }
    61 
    62     jsPropertyNameIterator->setCachedPrototypeChain(structureChain);
    63     jsPropertyNameIterator->setCachedStructure(o->structure());
    64     o->structure()->setEnumerationCache(jsPropertyNameIterator);
    65     return jsPropertyNameIterator;
    66 }
    67 
    68 JSValue JSPropertyNameIterator::get(ExecState* exec, JSObject* base, size_t i)
    69 {
    70     JSValue& identifier = m_jsStrings[i];
    71     if (m_cachedStructure == base->structure() && m_cachedPrototypeChain == base->structure()->prototypeChain(exec))
    72         return identifier;
    73 
    74     if (!base->hasProperty(exec, Identifier(exec, asString(identifier)->value())))
    75         return JSValue();
    76     return identifier;
    7738}
    7839
    7940void JSPropertyNameIterator::markChildren(MarkStack& markStack)
    8041{
    81     markStack.appendValues(m_jsStrings.get(), m_jsStringsSize, MayContainNullValues);
     42    JSCell::markChildren(markStack);
     43    if (m_object)
     44        markStack.append(m_object);
     45}
     46
     47void JSPropertyNameIterator::invalidate()
     48{
     49    ASSERT(m_position == m_end);
     50    m_object = 0;
     51    m_data.clear();
    8252}
    8353
Note: See TracChangeset for help on using the changeset viewer.