Changeset 10076 in webkit for trunk/JavaScriptCore/kjs/property_map.cpp
- Timestamp:
- Aug 6, 2005, 11:17:49 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/property_map.cpp
r9992 r10076 233 233 } 234 234 235 ValueImp **PropertyMap::getLocation(const Identifier &name) 236 { 237 assert(!name.isNull()); 238 239 UString::Rep *rep = name._ustring.rep; 240 241 if (!_table) { 242 #if USE_SINGLE_ENTRY 243 UString::Rep *key = _singleEntry.key; 244 if (rep == key) 245 return &_singleEntry.value; 246 #endif 247 return 0; 248 } 249 250 unsigned h = rep->hash(); 251 int sizeMask = _table->sizeMask; 252 Entry *entries = _table->entries; 253 int i = h & sizeMask; 254 int k = 0; 255 #if DUMP_STATISTICS 256 ++numProbes; 257 numCollisions += entries[i].key && entries[i].key != rep; 258 #endif 259 while (UString::Rep *key = entries[i].key) { 260 if (rep == key) 261 return &entries[i].value; 262 if (k == 0) 263 k = 1 | (h % sizeMask); 264 i = (i + k) & sizeMask; 265 #if DUMP_STATISTICS 266 ++numRehashes; 267 #endif 268 } 269 return 0; 270 } 271 235 272 #if DEBUG_PROPERTIES 236 273 static void printAttributes(int attributes)
Note:
See TracChangeset
for help on using the changeset viewer.