Ignore:
Timestamp:
Nov 19, 2002, 10:44:25 AM (23 years ago)
Author:
darin
Message:
  • another hash table fix; yields a 2% improvement on iBench JavaScript
  • kjs/property_map.cpp: A few more places where we use & instead of %.
  • some List changes that don't affect speed yet
  • kjs/types.cpp: (List::prependList): Tighten up a tiny bit. (List::copy): Use prependList.
  • kjs/types.h: Remove appendList and globalClear.
  • kjs/interpreter.cpp: (Interpreter::finalCheck): Remove List::globalClear().
File:
1 edited

Legend:

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

    r2751 r2757  
    111111            return _table[i].value;
    112112        }
    113         i = (i + 1) % _tableSize;
     113        i = (i + 1) & _tableSizeHashMask;
    114114    }
    115115    return 0;
     
    129129        if (keysMatch(name.rep, key))
    130130            return _table[i].value;
    131         i = (i + 1) % _tableSize;
     131        i = (i + 1) & _tableSizeHashMask;
    132132    }
    133133    return 0;
     
    153153    }
    154154
    155     if (_keyCount >= _tableSize / 2)
     155    if (_keyCount * 2 >= _tableSize)
    156156        expand();
    157157   
     
    164164            return;
    165165        }
    166         i = (i + 1) % _tableSize;
     166        i = (i + 1) & _tableSizeHashMask;
    167167    }
    168168   
     
    179179    int i = hash(key);
    180180    while (_table[i].key)
    181         i = (i + 1) % _tableSize;
     181        i = (i + 1) & _tableSizeHashMask;
    182182   
    183183    _table[i].key = key;
     
    229229        if (keysMatch(name.rep, key))
    230230            break;
    231         i = (i + 1) % _tableSize;
     231        i = (i + 1) & _tableSizeHashMask;
    232232    }
    233233    if (!key)
     
    241241    // Reinsert all the items to the right in the same cluster.
    242242    while (1) {
    243         i = (i + 1) % _tableSize;
     243        i = (i + 1) & _tableSizeHashMask;
    244244        key = _table[i].key;
    245245        if (!key)
Note: See TracChangeset for help on using the changeset viewer.