Ignore:
Timestamp:
Apr 16, 2009, 11:20:32 PM (16 years ago)
Author:
Stephanie Lewis
Message:

2009-04-16 Stephanie Lewis <Stephanie Lewis>

Reviewed by Oliver Hunt.

<rdar://problem/6744652> 32-bit to 64-bit: Javascript hash tables double in size

Remove perfect hash optimization which removes 1 MB of overhead on 32-bit and almost 2 MB on 64-bit. Removing the optimization was not a regression on SunSpider and the acid 3 test still passes.

  • create_hash_table:
  • runtime/Lookup.cpp: (JSC::HashTable::createTable): (JSC::HashTable::deleteTable):
  • runtime/Lookup.h: (JSC::HashEntry::initialize): (JSC::HashEntry::next): (JSC::HashTable::entry):
  • runtime/Structure.cpp: (JSC::Structure::getEnumerableNamesFromClassInfoTable):
File:
1 edited

Legend:

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

    r39670 r42606  
    2727void HashTable::createTable(JSGlobalData* globalData) const
    2828{
    29 #if ENABLE(PERFECT_HASH_SIZE)
    30     ASSERT(!table);
    31     HashEntry* entries = new HashEntry[hashSizeMask + 1];
    32     for (int i = 0; i <= hashSizeMask; ++i)
    33         entries[i].setKey(0);
    34     for (int i = 0; values[i].key; ++i) {
    35         UString::Rep* identifier = Identifier::add(globalData, values[i].key).releaseRef();
    36         int hashIndex = identifier->computedHash() & hashSizeMask;
    37         ASSERT(!entries[hashIndex].key());
    38         entries[hashIndex].initialize(identifier, values[i].attributes, values[i].value1, values[i].value2);
    39     }
    40     table = entries;
    41 #else
    4229    ASSERT(!table);
    4330    int linkIndex = compactHashSizeMask + 1;
     
    6249    }
    6350    table = entries;
    64 #endif
    6551}
    6652
     
    6854{
    6955    if (table) {
    70 #if ENABLE(PERFECT_HASH_SIZE)
    71         int max = hashSizeMask + 1;
    72 #else
    7356        int max = compactSize;
    74 #endif
    7557        for (int i = 0; i != max; ++i) {
    7658            if (UString::Rep* key = table[i].key())
Note: See TracChangeset for help on using the changeset viewer.