Ignore:
Timestamp:
Oct 15, 2005, 5:46:25 PM (20 years ago)
Author:
mjs
Message:

Reverted fix for this bug, because it was part of a time range that caused a performance
regression:

<rdar://problem/4260481> Remove Reference type from JavaScriptCore

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/property_map.cpp

    r10744 r10857  
    2626#include "object.h"
    2727#include "protect.h"
    28 #include "IdentifierSequencedSet.h"
     28#include "reference_list.h"
    2929
    3030#include <algorithm>
     
    7575
    7676// lastIndexUsed is an ever-increasing index used to identify the order items
    77 // were inserted into the property map. It's vital that getEnumerablePropertyNames
     77// were inserted into the property map. It's vital that addEnumerablesToReferenceList
    7878// return the properties in the order they were added for compatibility with other
    7979// browsers' JavaScript implementations.
     
    567567}
    568568
    569 void PropertyMap::getEnumerablePropertyNames(IdentifierSequencedSet& propertyNames) const
     569void PropertyMap::addEnumerablesToReferenceList(ReferenceList &list, ObjectImp *base) const
    570570{
    571571    if (!_table) {
     
    573573        UString::Rep *key = _singleEntry.key;
    574574        if (key && !(_singleEntry.attributes & DontEnum))
    575             propertyNames.insert(Identifier(key));
     575            list.append(Reference(base, Identifier(key)));
    576576#endif
    577577        return;
     
    599599    qsort(sortedEnumerables, p - sortedEnumerables, sizeof(sortedEnumerables[0]), comparePropertyMapEntryIndices);
    600600
    601     // Put the keys of the sorted entries into the list.
     601    // Put the keys of the sorted entries into the reference list.
    602602    Entry **q = sortedEnumerables;
    603     while (q != p) {
    604         propertyNames.insert(Identifier(q[0]->key));
    605         ++q;
    606     }
     603    while (q != p)
     604        list.append(Reference(base, Identifier((*q++)->key)));
    607605
    608606    // Deallocate the buffer.
     
    611609}
    612610
    613 void PropertyMap::getSparseArrayPropertyNames(IdentifierSequencedSet& propertyNames) const
     611void PropertyMap::addSparseArrayPropertiesToReferenceList(ReferenceList &list, ObjectImp *base) const
    614612{
    615613    if (!_table) {
     
    621619            k.toUInt32(&fitsInUInt32);
    622620            if (fitsInUInt32)
    623                 propertyNames.insert(Identifier(key));
     621                list.append(Reference(base, Identifier(key)));
    624622        }
    625623#endif
     
    636634            k.toUInt32(&fitsInUInt32);
    637635            if (fitsInUInt32)
    638                 propertyNames.insert(Identifier(key));
     636                list.append(Reference(base, Identifier(key)));
    639637        }
    640638    }
Note: See TracChangeset for help on using the changeset viewer.