| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2283 | 2283 |
| 2284 // Find entry for key otherwise return kNotFound. | 2284 // Find entry for key otherwise return kNotFound. |
| 2285 template<typename Shape, typename Key> | 2285 template<typename Shape, typename Key> |
| 2286 int HashTable<Shape, Key>::FindEntry(Isolate* isolate, Key key) { | 2286 int HashTable<Shape, Key>::FindEntry(Isolate* isolate, Key key) { |
| 2287 uint32_t capacity = Capacity(); | 2287 uint32_t capacity = Capacity(); |
| 2288 uint32_t entry = FirstProbe(HashTable<Shape, Key>::Hash(key), capacity); | 2288 uint32_t entry = FirstProbe(HashTable<Shape, Key>::Hash(key), capacity); |
| 2289 uint32_t count = 1; | 2289 uint32_t count = 1; |
| 2290 // EnsureCapacity will guarantee the hash table is never full. | 2290 // EnsureCapacity will guarantee the hash table is never full. |
| 2291 while (true) { | 2291 while (true) { |
| 2292 Object* element = KeyAt(entry); | 2292 Object* element = KeyAt(entry); |
| 2293 // Empty entry. | 2293 // Empty entry. Uses raw unchecked accessors because it is called by the |
| 2294 if (element == isolate->heap()->undefined_value()) break; | 2294 // symbol table during bootstrapping. |
| 2295 if (element != isolate->heap()->the_hole_value() && | 2295 if (element == isolate->heap()->raw_unchecked_undefined_value()) break; |
| 2296 if (element != isolate->heap()->raw_unchecked_the_hole_value() && |
| 2296 Shape::IsMatch(key, element)) return entry; | 2297 Shape::IsMatch(key, element)) return entry; |
| 2297 entry = NextProbe(entry, count++, capacity); | 2298 entry = NextProbe(entry, count++, capacity); |
| 2298 } | 2299 } |
| 2299 return kNotFound; | 2300 return kNotFound; |
| 2300 } | 2301 } |
| 2301 | 2302 |
| 2302 | 2303 |
| 2303 bool SeededNumberDictionary::requires_slow_elements() { | 2304 bool SeededNumberDictionary::requires_slow_elements() { |
| 2304 Object* max_index_object = get(kMaxNumberKeyIndex); | 2305 Object* max_index_object = get(kMaxNumberKeyIndex); |
| 2305 if (!max_index_object->IsSmi()) return false; | 2306 if (!max_index_object->IsSmi()) return false; |
| (...skipping 3234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5540 #undef WRITE_UINT32_FIELD | 5541 #undef WRITE_UINT32_FIELD |
| 5541 #undef READ_SHORT_FIELD | 5542 #undef READ_SHORT_FIELD |
| 5542 #undef WRITE_SHORT_FIELD | 5543 #undef WRITE_SHORT_FIELD |
| 5543 #undef READ_BYTE_FIELD | 5544 #undef READ_BYTE_FIELD |
| 5544 #undef WRITE_BYTE_FIELD | 5545 #undef WRITE_BYTE_FIELD |
| 5545 | 5546 |
| 5546 | 5547 |
| 5547 } } // namespace v8::internal | 5548 } } // namespace v8::internal |
| 5548 | 5549 |
| 5549 #endif // V8_OBJECTS_INL_H_ | 5550 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |