Changeset 176290 in webkit
- Timestamp:
- Nov 18, 2014, 3:06:00 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 13 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/ListHashSet.h (modified) (35 diffs)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/dom/DOMNamedFlowCollection.h (modified) (1 diff)
-
WebCore/dom/DocumentEventQueue.h (modified) (1 diff)
-
WebCore/dom/DocumentStyleSheetCollection.h (modified) (1 diff)
-
WebCore/dom/NamedFlowCollection.h (modified) (1 diff)
-
WebCore/html/FormController.h (modified) (1 diff)
-
WebCore/rendering/FloatingObjects.h (modified) (1 diff)
-
WebCore/rendering/RenderBlock.h (modified) (1 diff)
-
WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in (modified) (1 diff)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/UIProcess/Plugins/PluginInfoStore.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r176275 r176290 1 2014-11-18 Geoffrey Garen <ggaren@apple.com> 2 3 Removed the custom allocator for ListHashSet nodes 4 https://bugs.webkit.org/show_bug.cgi?id=138841 5 6 Reviewed by Andreas Kling. 7 8 bmalloc is fast, so we don't need a custom allocator. 9 10 The MallocBench test for linked list node allocation (list_allocate) is 11 4.09X faster in bmalloc than TCMalloc. Also, I wrote a stress test to 12 add/remove link elements, which modify a ListHashSet on insertion and 13 removal, and it was 1% faster / in the noise with bmalloc enabled. 14 15 * wtf/ListHashSet.h: 16 (WTF::ListHashSetNode::ListHashSetNode): 17 (WTF::ListHashSetTranslator::translate): 18 (WTF::U>::ListHashSet): 19 (WTF::=): 20 (WTF::U>::swap): 21 (WTF::U>::~ListHashSet): 22 (WTF::U>::size): 23 (WTF::U>::capacity): 24 (WTF::U>::isEmpty): 25 (WTF::U>::first): 26 (WTF::U>::removeFirst): 27 (WTF::U>::takeFirst): 28 (WTF::U>::last): 29 (WTF::U>::removeLast): 30 (WTF::U>::takeLast): 31 (WTF::U>::contains): 32 (WTF::U>::remove): 33 (WTF::U>::clear): 34 (WTF::U>::unlink): 35 (WTF::U>::unlinkAndDelete): 36 (WTF::U>::appendNode): 37 (WTF::U>::prependNode): 38 (WTF::U>::insertNodeBefore): 39 (WTF::U>::deleteAllNodes): 40 (WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator): Deleted. 41 (WTF::ListHashSetNodeAllocator::allocate): Deleted. 42 (WTF::ListHashSetNodeAllocator::deallocate): Deleted. 43 (WTF::ListHashSetNodeAllocator::pool): Deleted. 44 (WTF::ListHashSetNodeAllocator::pastPool): Deleted. 45 (WTF::ListHashSetNodeAllocator::inPool): Deleted. 46 (WTF::ListHashSetNode::operator new): Deleted. 47 (WTF::ListHashSetNode::destroy): Deleted. 48 1 49 2014-11-18 Chris Dumez <cdumez@apple.com> 2 50 -
trunk/Source/WTF/wtf/ListHashSet.h
r170774 r176290 39 39 // removal of the item currently pointed to by a given iterator. 40 40 41 template<typename Value, size_t inlineCapacity, typename HashFunctions> class ListHashSet; 42 43 template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetIterator; 44 template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetConstIterator; 45 46 template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNode; 47 template<typename ValueArg, size_t inlineCapacity> class ListHashSetNodeAllocator; 41 template<typename Value, typename HashFunctions> class ListHashSet; 42 43 template<typename ValueArg, typename HashArg> class ListHashSetIterator; 44 template<typename ValueArg, typename HashArg> class ListHashSetConstIterator; 45 46 template<typename ValueArg> struct ListHashSetNode; 48 47 49 48 template<typename HashArg> struct ListHashSetNodeHashFunctions; 50 49 template<typename HashArg> struct ListHashSetTranslator; 51 50 52 template<typename ValueArg, size_t inlineCapacity = 256,typename HashArg = typename DefaultHash<ValueArg>::Hash> class ListHashSet {51 template<typename ValueArg, typename HashArg = typename DefaultHash<ValueArg>::Hash> class ListHashSet { 53 52 WTF_MAKE_FAST_ALLOCATED; 54 53 private: 55 typedef ListHashSetNode<ValueArg, inlineCapacity> Node; 56 typedef ListHashSetNodeAllocator<ValueArg, inlineCapacity> NodeAllocator; 54 typedef ListHashSetNode<ValueArg> Node; 57 55 58 56 typedef HashTraits<Node*> NodeTraits; … … 65 63 typedef ValueArg ValueType; 66 64 67 typedef ListHashSetIterator<ValueType, inlineCapacity,HashArg> iterator;68 typedef ListHashSetConstIterator<ValueType, inlineCapacity,HashArg> const_iterator;69 friend class ListHashSetConstIterator<ValueType, inlineCapacity,HashArg>;65 typedef ListHashSetIterator<ValueType, HashArg> iterator; 66 typedef ListHashSetConstIterator<ValueType, HashArg> const_iterator; 67 friend class ListHashSetConstIterator<ValueType, HashArg>; 70 68 71 69 typedef std::reverse_iterator<iterator> reverse_iterator; … … 156 154 Node* m_head; 157 155 Node* m_tail; 158 std::unique_ptr<NodeAllocator> m_allocator;159 156 }; 160 157 161 template<typename ValueArg , size_t inlineCapacity> class ListHashSetNodeAllocator{158 template<typename ValueArg> struct ListHashSetNode { 162 159 WTF_MAKE_FAST_ALLOCATED; 163 164 160 public: 165 typedef ListHashSetNode<ValueArg, inlineCapacity> Node;166 typedef ListHashSetNodeAllocator<ValueArg, inlineCapacity> NodeAllocator;167 168 ListHashSetNodeAllocator()169 : m_freeList(pool())170 , m_isDoneWithInitialFreeList(false)171 {172 memset(m_pool.pool, 0, sizeof(m_pool.pool));173 }174 175 Node* allocate()176 {177 Node* result = m_freeList;178 179 if (!result)180 return static_cast<Node*>(fastMalloc(sizeof(Node)));181 182 ASSERT(!result->m_isAllocated);183 184 Node* next = result->m_next;185 ASSERT(!next || !next->m_isAllocated);186 if (!next && !m_isDoneWithInitialFreeList) {187 next = result + 1;188 if (next == pastPool()) {189 m_isDoneWithInitialFreeList = true;190 next = 0;191 } else {192 ASSERT(inPool(next));193 ASSERT(!next->m_isAllocated);194 }195 }196 m_freeList = next;197 198 return result;199 }200 201 void deallocate(Node* node)202 {203 if (inPool(node)) {204 #ifndef NDEBUG205 node->m_isAllocated = false;206 #endif207 node->m_next = m_freeList;208 m_freeList = node;209 return;210 }211 212 fastFree(node);213 }214 215 private:216 Node* pool() { return reinterpret_cast_ptr<Node*>(m_pool.pool); }217 Node* pastPool() { return pool() + m_poolSize; }218 bool inPool(Node* node)219 {220 return node >= pool() && node < pastPool();221 }222 223 Node* m_freeList;224 bool m_isDoneWithInitialFreeList;225 static const size_t m_poolSize = inlineCapacity;226 union {227 char pool[sizeof(Node) * m_poolSize];228 double forAlignment;229 } m_pool;230 };231 232 template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNode {233 typedef ListHashSetNodeAllocator<ValueArg, inlineCapacity> NodeAllocator;234 235 161 template<typename T> 236 162 ListHashSetNode(T&& value) … … 238 164 , m_prev(0) 239 165 , m_next(0) 240 #ifndef NDEBUG 241 , m_isAllocated(true) 242 #endif 243 { 244 } 245 246 void* operator new(size_t, NodeAllocator* allocator) 247 { 248 return allocator->allocate(); 249 } 250 void destroy(NodeAllocator* allocator) 251 { 252 this->~ListHashSetNode(); 253 allocator->deallocate(this); 166 { 254 167 } 255 168 … … 257 170 ListHashSetNode* m_prev; 258 171 ListHashSetNode* m_next; 259 260 #ifndef NDEBUG261 bool m_isAllocated;262 #endif263 172 }; 264 173 … … 269 178 }; 270 179 271 template<typename ValueArg, size_t inlineCapacity,typename HashArg> class ListHashSetIterator {180 template<typename ValueArg, typename HashArg> class ListHashSetIterator { 272 181 private: 273 typedef ListHashSet<ValueArg, inlineCapacity,HashArg> ListHashSetType;274 typedef ListHashSetIterator<ValueArg, inlineCapacity,HashArg> iterator;275 typedef ListHashSetConstIterator<ValueArg, inlineCapacity,HashArg> const_iterator;276 typedef ListHashSetNode<ValueArg , inlineCapacity> Node;182 typedef ListHashSet<ValueArg, HashArg> ListHashSetType; 183 typedef ListHashSetIterator<ValueArg, HashArg> iterator; 184 typedef ListHashSetConstIterator<ValueArg, HashArg> const_iterator; 185 typedef ListHashSetNode<ValueArg> Node; 277 186 typedef ValueArg ValueType; 278 187 279 friend class ListHashSet<ValueArg, inlineCapacity,HashArg>;188 friend class ListHashSet<ValueArg, HashArg>; 280 189 281 190 ListHashSetIterator(const ListHashSetType* set, Node* position) : m_iterator(set, position) { } … … 316 225 }; 317 226 318 template<typename ValueArg, size_t inlineCapacity,typename HashArg> class ListHashSetConstIterator {227 template<typename ValueArg, typename HashArg> class ListHashSetConstIterator { 319 228 private: 320 typedef ListHashSet<ValueArg, inlineCapacity,HashArg> ListHashSetType;321 typedef ListHashSetIterator<ValueArg, inlineCapacity,HashArg> iterator;322 typedef ListHashSetConstIterator<ValueArg, inlineCapacity,HashArg> const_iterator;323 typedef ListHashSetNode<ValueArg , inlineCapacity> Node;229 typedef ListHashSet<ValueArg, HashArg> ListHashSetType; 230 typedef ListHashSetIterator<ValueArg, HashArg> iterator; 231 typedef ListHashSetConstIterator<ValueArg, HashArg> const_iterator; 232 typedef ListHashSetNode<ValueArg> Node; 324 233 typedef ValueArg ValueType; 325 234 326 friend class ListHashSet<ValueArg, inlineCapacity,HashArg>;327 friend class ListHashSetIterator<ValueArg, inlineCapacity,HashArg>;235 friend class ListHashSet<ValueArg, HashArg>; 236 friend class ListHashSetIterator<ValueArg, HashArg>; 328 237 329 238 ListHashSetConstIterator(const ListHashSetType* set, Node* position) … … 394 303 template<typename T> static unsigned hash(const T& key) { return HashFunctions::hash(key); } 395 304 template<typename T, typename U> static bool equal(const T& a, const U& b) { return HashFunctions::equal(a->m_value, b); } 396 template<typename T, typename U, typename V> static void translate(T*& location, U&& key, const V& allocator)397 { 398 location = new (allocator)T(std::forward<U>(key));305 template<typename T, typename U, typename V> static void translate(T*& location, U&& key, V&&) 306 { 307 location = new T(std::forward<U>(key)); 399 308 } 400 309 }; 401 310 402 template<typename T, size_t inlineCapacity,typename U>403 inline ListHashSet<T, inlineCapacity,U>::ListHashSet()311 template<typename T, typename U> 312 inline ListHashSet<T, U>::ListHashSet() 404 313 : m_head(0) 405 314 , m_tail(0) 406 , m_allocator(std::make_unique<NodeAllocator>()) 407 { 408 } 409 410 template<typename T, size_t inlineCapacity, typename U> 411 inline ListHashSet<T, inlineCapacity, U>::ListHashSet(const ListHashSet& other) 315 { 316 } 317 318 template<typename T, typename U> 319 inline ListHashSet<T, U>::ListHashSet(const ListHashSet& other) 412 320 : m_head(0) 413 321 , m_tail(0) 414 , m_allocator(std::make_unique<NodeAllocator>())415 322 { 416 323 for (auto it = other.begin(), end = other.end(); it != end; ++it) … … 418 325 } 419 326 420 template<typename T, size_t inlineCapacity,typename U>421 inline ListHashSet<T, inlineCapacity, U>& ListHashSet<T, inlineCapacity, U>::operator=(const ListHashSet& other)327 template<typename T, typename U> 328 inline ListHashSet<T, U>& ListHashSet<T, U>::operator=(const ListHashSet& other) 422 329 { 423 330 ListHashSet tmp(other); … … 426 333 } 427 334 428 template<typename T, size_t inlineCapacity,typename U>429 inline void ListHashSet<T, inlineCapacity,U>::swap(ListHashSet& other)335 template<typename T, typename U> 336 inline void ListHashSet<T, U>::swap(ListHashSet& other) 430 337 { 431 338 m_impl.swap(other.m_impl); 432 339 std::swap(m_head, other.m_head); 433 340 std::swap(m_tail, other.m_tail); 434 m_allocator.swap(other.m_allocator); 435 } 436 437 template<typename T, size_t inlineCapacity, typename U> 438 inline ListHashSet<T, inlineCapacity, U>::~ListHashSet() 341 } 342 343 template<typename T, typename U> 344 inline ListHashSet<T, U>::~ListHashSet() 439 345 { 440 346 deleteAllNodes(); 441 347 } 442 348 443 template<typename T, size_t inlineCapacity,typename U>444 inline int ListHashSet<T, inlineCapacity,U>::size() const349 template<typename T, typename U> 350 inline int ListHashSet<T, U>::size() const 445 351 { 446 352 return m_impl.size(); 447 353 } 448 354 449 template<typename T, size_t inlineCapacity,typename U>450 inline int ListHashSet<T, inlineCapacity,U>::capacity() const355 template<typename T, typename U> 356 inline int ListHashSet<T, U>::capacity() const 451 357 { 452 358 return m_impl.capacity(); 453 359 } 454 360 455 template<typename T, size_t inlineCapacity,typename U>456 inline bool ListHashSet<T, inlineCapacity,U>::isEmpty() const361 template<typename T, typename U> 362 inline bool ListHashSet<T, U>::isEmpty() const 457 363 { 458 364 return m_impl.isEmpty(); 459 365 } 460 366 461 template<typename T, size_t inlineCapacity,typename U>462 inline T& ListHashSet<T, inlineCapacity,U>::first()367 template<typename T, typename U> 368 inline T& ListHashSet<T, U>::first() 463 369 { 464 370 ASSERT(!isEmpty()); … … 466 372 } 467 373 468 template<typename T, size_t inlineCapacity,typename U>469 inline void ListHashSet<T, inlineCapacity,U>::removeFirst()374 template<typename T, typename U> 375 inline void ListHashSet<T, U>::removeFirst() 470 376 { 471 377 takeFirst(); 472 378 } 473 379 474 template<typename T, size_t inlineCapacity,typename U>475 inline T ListHashSet<T, inlineCapacity,U>::takeFirst()380 template<typename T, typename U> 381 inline T ListHashSet<T, U>::takeFirst() 476 382 { 477 383 ASSERT(!isEmpty()); … … 485 391 } 486 392 487 template<typename T, size_t inlineCapacity,typename U>488 inline const T& ListHashSet<T, inlineCapacity,U>::first() const393 template<typename T, typename U> 394 inline const T& ListHashSet<T, U>::first() const 489 395 { 490 396 ASSERT(!isEmpty()); … … 492 398 } 493 399 494 template<typename T, size_t inlineCapacity,typename U>495 inline T& ListHashSet<T, inlineCapacity,U>::last()400 template<typename T, typename U> 401 inline T& ListHashSet<T, U>::last() 496 402 { 497 403 ASSERT(!isEmpty()); … … 499 405 } 500 406 501 template<typename T, size_t inlineCapacity,typename U>502 inline const T& ListHashSet<T, inlineCapacity,U>::last() const407 template<typename T, typename U> 408 inline const T& ListHashSet<T, U>::last() const 503 409 { 504 410 ASSERT(!isEmpty()); … … 506 412 } 507 413 508 template<typename T, size_t inlineCapacity,typename U>509 inline void ListHashSet<T, inlineCapacity,U>::removeLast()414 template<typename T, typename U> 415 inline void ListHashSet<T, U>::removeLast() 510 416 { 511 417 takeLast(); 512 418 } 513 419 514 template<typename T, size_t inlineCapacity,typename U>515 inline T ListHashSet<T, inlineCapacity,U>::takeLast()420 template<typename T, typename U> 421 inline T ListHashSet<T, U>::takeLast() 516 422 { 517 423 ASSERT(!isEmpty()); … … 525 431 } 526 432 527 template<typename T, size_t inlineCapacity,typename U>528 inline auto ListHashSet<T, inlineCapacity,U>::find(const ValueType& value) -> iterator433 template<typename T, typename U> 434 inline auto ListHashSet<T, U>::find(const ValueType& value) -> iterator 529 435 { 530 436 auto it = m_impl.template find<BaseTranslator>(value); … … 534 440 } 535 441 536 template<typename T, size_t inlineCapacity,typename U>537 inline auto ListHashSet<T, inlineCapacity,U>::find(const ValueType& value) const -> const_iterator442 template<typename T, typename U> 443 inline auto ListHashSet<T, U>::find(const ValueType& value) const -> const_iterator 538 444 { 539 445 auto it = m_impl.template find<BaseTranslator>(value); … … 549 455 }; 550 456 551 template<typename ValueType, size_t inlineCapacity,typename U>457 template<typename ValueType, typename U> 552 458 template<typename T, typename HashTranslator> 553 inline auto ListHashSet<ValueType, inlineCapacity,U>::find(const T& value) -> iterator459 inline auto ListHashSet<ValueType, U>::find(const T& value) -> iterator 554 460 { 555 461 auto it = m_impl.template find<ListHashSetTranslatorAdapter<HashTranslator>>(value); … … 559 465 } 560 466 561 template<typename ValueType, size_t inlineCapacity,typename U>467 template<typename ValueType, typename U> 562 468 template<typename T, typename HashTranslator> 563 inline auto ListHashSet<ValueType, inlineCapacity,U>::find(const T& value) const -> const_iterator469 inline auto ListHashSet<ValueType, U>::find(const T& value) const -> const_iterator 564 470 { 565 471 auto it = m_impl.template find<ListHashSetTranslatorAdapter<HashTranslator>>(value); … … 569 475 } 570 476 571 template<typename ValueType, size_t inlineCapacity,typename U>477 template<typename ValueType, typename U> 572 478 template<typename T, typename HashTranslator> 573 inline bool ListHashSet<ValueType, inlineCapacity,U>::contains(const T& value) const479 inline bool ListHashSet<ValueType, U>::contains(const T& value) const 574 480 { 575 481 return m_impl.template contains<ListHashSetTranslatorAdapter<HashTranslator>>(value); 576 482 } 577 483 578 template<typename T, size_t inlineCapacity,typename U>579 inline bool ListHashSet<T, inlineCapacity,U>::contains(const ValueType& value) const484 template<typename T, typename U> 485 inline bool ListHashSet<T, U>::contains(const ValueType& value) const 580 486 { 581 487 return m_impl.template contains<BaseTranslator>(value); 582 488 } 583 489 584 template<typename T, size_t inlineCapacity,typename U>585 auto ListHashSet<T, inlineCapacity,U>::add(const ValueType& value) -> AddResult586 { 587 auto result = m_impl.template add<BaseTranslator>(value, m_allocator.get());490 template<typename T, typename U> 491 auto ListHashSet<T, U>::add(const ValueType& value) -> AddResult 492 { 493 auto result = m_impl.template add<BaseTranslator>(value, nullptr); 588 494 if (result.isNewEntry) 589 495 appendNode(*result.iterator); … … 591 497 } 592 498 593 template<typename T, size_t inlineCapacity,typename U>594 auto ListHashSet<T, inlineCapacity,U>::add(ValueType&& value) -> AddResult595 { 596 auto result = m_impl.template add<BaseTranslator>(WTF::move(value), m_allocator.get());499 template<typename T, typename U> 500 auto ListHashSet<T, U>::add(ValueType&& value) -> AddResult 501 { 502 auto result = m_impl.template add<BaseTranslator>(WTF::move(value), nullptr); 597 503 if (result.isNewEntry) 598 504 appendNode(*result.iterator); … … 600 506 } 601 507 602 template<typename T, size_t inlineCapacity,typename U>603 auto ListHashSet<T, inlineCapacity,U>::appendOrMoveToLast(const ValueType& value) -> AddResult604 { 605 auto result = m_impl.template add<BaseTranslator>(value, m_allocator.get());508 template<typename T, typename U> 509 auto ListHashSet<T, U>::appendOrMoveToLast(const ValueType& value) -> AddResult 510 { 511 auto result = m_impl.template add<BaseTranslator>(value, nullptr); 606 512 Node* node = *result.iterator; 607 513 if (!result.isNewEntry) … … 612 518 } 613 519 614 template<typename T, size_t inlineCapacity,typename U>615 auto ListHashSet<T, inlineCapacity,U>::appendOrMoveToLast(ValueType&& value) -> AddResult616 { 617 auto result = m_impl.template add<BaseTranslator>(WTF::move(value), m_allocator.get());520 template<typename T, typename U> 521 auto ListHashSet<T, U>::appendOrMoveToLast(ValueType&& value) -> AddResult 522 { 523 auto result = m_impl.template add<BaseTranslator>(WTF::move(value), nullptr); 618 524 Node* node = *result.iterator; 619 525 if (!result.isNewEntry) … … 624 530 } 625 531 626 template<typename T, size_t inlineCapacity,typename U>627 auto ListHashSet<T, inlineCapacity,U>::prependOrMoveToFirst(const ValueType& value) -> AddResult628 { 629 auto result = m_impl.template add<BaseTranslator>(value, m_allocator.get());532 template<typename T, typename U> 533 auto ListHashSet<T, U>::prependOrMoveToFirst(const ValueType& value) -> AddResult 534 { 535 auto result = m_impl.template add<BaseTranslator>(value, nullptr); 630 536 Node* node = *result.iterator; 631 537 if (!result.isNewEntry) … … 636 542 } 637 543 638 template<typename T, size_t inlineCapacity,typename U>639 auto ListHashSet<T, inlineCapacity,U>::prependOrMoveToFirst(ValueType&& value) -> AddResult640 { 641 auto result = m_impl.template add<BaseTranslator>(WTF::move(value), m_allocator.get());544 template<typename T, typename U> 545 auto ListHashSet<T, U>::prependOrMoveToFirst(ValueType&& value) -> AddResult 546 { 547 auto result = m_impl.template add<BaseTranslator>(WTF::move(value), nullptr); 642 548 Node* node = *result.iterator; 643 549 if (!result.isNewEntry) … … 648 554 } 649 555 650 template<typename T, size_t inlineCapacity,typename U>651 auto ListHashSet<T, inlineCapacity,U>::insertBefore(const ValueType& beforeValue, const ValueType& newValue) -> AddResult556 template<typename T, typename U> 557 auto ListHashSet<T, U>::insertBefore(const ValueType& beforeValue, const ValueType& newValue) -> AddResult 652 558 { 653 559 return insertBefore(find(beforeValue), newValue); 654 560 } 655 561 656 template<typename T, size_t inlineCapacity,typename U>657 auto ListHashSet<T, inlineCapacity,U>::insertBefore(const ValueType& beforeValue, ValueType&& newValue) -> AddResult562 template<typename T, typename U> 563 auto ListHashSet<T, U>::insertBefore(const ValueType& beforeValue, ValueType&& newValue) -> AddResult 658 564 { 659 565 return insertBefore(find(beforeValue), WTF::move(newValue)); 660 566 } 661 567 662 template<typename T, size_t inlineCapacity,typename U>663 auto ListHashSet<T, inlineCapacity,U>::insertBefore(iterator it, const ValueType& newValue) -> AddResult664 { 665 auto result = m_impl.template add<BaseTranslator>(newValue, m_allocator.get());568 template<typename T, typename U> 569 auto ListHashSet<T, U>::insertBefore(iterator it, const ValueType& newValue) -> AddResult 570 { 571 auto result = m_impl.template add<BaseTranslator>(newValue, nullptr); 666 572 if (result.isNewEntry) 667 573 insertNodeBefore(it.node(), *result.iterator); … … 669 575 } 670 576 671 template<typename T, size_t inlineCapacity,typename U>672 auto ListHashSet<T, inlineCapacity,U>::insertBefore(iterator it, ValueType&& newValue) -> AddResult673 { 674 auto result = m_impl.template add<BaseTranslator>(WTF::move(newValue), m_allocator.get());577 template<typename T, typename U> 578 auto ListHashSet<T, U>::insertBefore(iterator it, ValueType&& newValue) -> AddResult 579 { 580 auto result = m_impl.template add<BaseTranslator>(WTF::move(newValue), nullptr); 675 581 if (result.isNewEntry) 676 582 insertNodeBefore(it.node(), *result.iterator); … … 678 584 } 679 585 680 template<typename T, size_t inlineCapacity,typename U>681 inline bool ListHashSet<T, inlineCapacity,U>::remove(iterator it)586 template<typename T, typename U> 587 inline bool ListHashSet<T, U>::remove(iterator it) 682 588 { 683 589 if (it == end()) … … 688 594 } 689 595 690 template<typename T, size_t inlineCapacity,typename U>691 inline bool ListHashSet<T, inlineCapacity,U>::remove(const ValueType& value)596 template<typename T, typename U> 597 inline bool ListHashSet<T, U>::remove(const ValueType& value) 692 598 { 693 599 return remove(find(value)); 694 600 } 695 601 696 template<typename T, size_t inlineCapacity,typename U>697 inline void ListHashSet<T, inlineCapacity,U>::clear()602 template<typename T, typename U> 603 inline void ListHashSet<T, U>::clear() 698 604 { 699 605 deleteAllNodes(); … … 703 609 } 704 610 705 template<typename T, size_t inlineCapacity,typename U>706 void ListHashSet<T, inlineCapacity,U>::unlink(Node* node)611 template<typename T, typename U> 612 void ListHashSet<T, U>::unlink(Node* node) 707 613 { 708 614 if (!node->m_prev) { … … 723 629 } 724 630 725 template<typename T, size_t inlineCapacity,typename U>726 void ListHashSet<T, inlineCapacity,U>::unlinkAndDelete(Node* node)631 template<typename T, typename U> 632 void ListHashSet<T, U>::unlinkAndDelete(Node* node) 727 633 { 728 634 unlink(node); 729 node->destroy(m_allocator.get());730 } 731 732 template<typename T, size_t inlineCapacity,typename U>733 void ListHashSet<T, inlineCapacity,U>::appendNode(Node* node)635 delete node; 636 } 637 638 template<typename T, typename U> 639 void ListHashSet<T, U>::appendNode(Node* node) 734 640 { 735 641 node->m_prev = m_tail; … … 747 653 } 748 654 749 template<typename T, size_t inlineCapacity,typename U>750 void ListHashSet<T, inlineCapacity,U>::prependNode(Node* node)655 template<typename T, typename U> 656 void ListHashSet<T, U>::prependNode(Node* node) 751 657 { 752 658 node->m_prev = 0; … … 761 667 } 762 668 763 template<typename T, size_t inlineCapacity,typename U>764 void ListHashSet<T, inlineCapacity,U>::insertNodeBefore(Node* beforeNode, Node* newNode)669 template<typename T, typename U> 670 void ListHashSet<T, U>::insertNodeBefore(Node* beforeNode, Node* newNode) 765 671 { 766 672 if (!beforeNode) … … 777 683 } 778 684 779 template<typename T, size_t inlineCapacity,typename U>780 void ListHashSet<T, inlineCapacity,U>::deleteAllNodes()685 template<typename T, typename U> 686 void ListHashSet<T, U>::deleteAllNodes() 781 687 { 782 688 if (!m_head) … … 784 690 785 691 for (Node* node = m_head, *next = m_head->m_next; node; node = next, next = node ? node->m_next : 0) 786 node->destroy(m_allocator.get());787 } 788 789 template<typename T, size_t inlineCapacity,typename U>790 inline auto ListHashSet<T, inlineCapacity,U>::makeIterator(Node* position) -> iterator692 delete node; 693 } 694 695 template<typename T, typename U> 696 inline auto ListHashSet<T, U>::makeIterator(Node* position) -> iterator 791 697 { 792 698 return iterator(this, position); 793 699 } 794 700 795 template<typename T, size_t inlineCapacity,typename U>796 inline auto ListHashSet<T, inlineCapacity,U>::makeConstIterator(Node* position) const -> const_iterator701 template<typename T, typename U> 702 inline auto ListHashSet<T, U>::makeConstIterator(Node* position) const -> const_iterator 797 703 { 798 704 return const_iterator(this, position); -
trunk/Source/WebCore/ChangeLog
r176287 r176290 1 2014-11-18 Geoffrey Garen <ggaren@apple.com> 2 3 Removed the custom allocator for ListHashSet nodes 4 https://bugs.webkit.org/show_bug.cgi?id=138841 5 6 Reviewed by Andreas Kling. 7 8 Uses of ListHashSet no longer need to declare an inline capacity, 9 since that was only used to specify the capacity of the custom allocator. 10 11 * dom/DOMNamedFlowCollection.h: 12 * dom/DocumentEventQueue.h: 13 * dom/DocumentStyleSheetCollection.h: 14 * dom/NamedFlowCollection.h: 15 * html/FormController.h: 16 * rendering/FloatingObjects.h: 17 * rendering/RenderBlock.h: 18 1 19 2014-11-18 David Hyatt <hyatt@apple.com> 2 20 -
trunk/Source/WebCore/dom/DOMNamedFlowCollection.h
r128325 r176290 58 58 struct DOMNamedFlowHashTranslator; 59 59 60 typedef ListHashSet<RefPtr<WebKitNamedFlow>, 1,DOMNamedFlowHashFunctions> DOMNamedFlowSet;60 typedef ListHashSet<RefPtr<WebKitNamedFlow>, DOMNamedFlowHashFunctions> DOMNamedFlowSet; 61 61 explicit DOMNamedFlowCollection(const Vector<WebKitNamedFlow*>&); 62 62 DOMNamedFlowSet m_namedFlows; -
trunk/Source/WebCore/dom/DocumentEventQueue.h
r165676 r176290 59 59 Document& m_document; 60 60 std::unique_ptr<Timer> m_pendingEventTimer; 61 ListHashSet<RefPtr<Event> , 16> m_queuedEvents;61 ListHashSet<RefPtr<Event>> m_queuedEvents; 62 62 HashSet<Node*> m_nodesWithQueuedScrollEvents; 63 63 bool m_isClosed; -
trunk/Source/WebCore/dom/DocumentStyleSheetCollection.h
r172814 r176290 153 153 UpdateFlag m_pendingUpdateType; 154 154 155 typedef ListHashSet<Node* , 32> StyleSheetCandidateListHashSet;155 typedef ListHashSet<Node*> StyleSheetCandidateListHashSet; 156 156 StyleSheetCandidateListHashSet m_styleSheetCandidateNodes; 157 157 -
trunk/Source/WebCore/dom/NamedFlowCollection.h
r175148 r176290 64 64 struct NamedFlowHashTranslator; 65 65 66 typedef ListHashSet<WebKitNamedFlow*, 1,NamedFlowHashFunctions> NamedFlowSet;66 typedef ListHashSet<WebKitNamedFlow*, NamedFlowHashFunctions> NamedFlowSet; 67 67 68 68 explicit NamedFlowCollection(Document*); -
trunk/Source/WebCore/html/FormController.h
r172862 r176290 96 96 97 97 private: 98 typedef ListHashSet<RefPtr<HTMLFormControlElementWithState> , 64> FormElementListHashSet;98 typedef ListHashSet<RefPtr<HTMLFormControlElementWithState>> FormElementListHashSet; 99 99 typedef HashMap<RefPtr<AtomicStringImpl>, std::unique_ptr<SavedFormState>> SavedFormStateMap; 100 100 -
trunk/Source/WebCore/rendering/FloatingObjects.h
r163631 r176290 112 112 }; 113 113 114 typedef ListHashSet<std::unique_ptr<FloatingObject>, 4,FloatingObjectHashFunctions> FloatingObjectSet;114 typedef ListHashSet<std::unique_ptr<FloatingObject>, FloatingObjectHashFunctions> FloatingObjectSet; 115 115 116 116 typedef PODInterval<LayoutUnit, FloatingObject*> FloatingObjectInterval; -
trunk/Source/WebCore/rendering/RenderBlock.h
r175640 r176290 41 41 struct PaintInfo; 42 42 43 typedef WTF::ListHashSet<RenderBox* , 16> TrackedRendererListHashSet;43 typedef WTF::ListHashSet<RenderBox*> TrackedRendererListHashSet; 44 44 typedef WTF::HashMap<const RenderBlock*, std::unique_ptr<TrackedRendererListHashSet>> TrackedDescendantsMap; 45 45 typedef WTF::HashMap<const RenderBox*, std::unique_ptr<HashSet<RenderBlock*>>> TrackedContainerMap; -
trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in
r176001 r176290 260 260 symbolWithPointer(?paintControlTints@FrameView@WebCore@@AAEXXZ, ?paintControlTints@FrameView@WebCore@@AEAAXXZ) 261 261 symbolWithPointer(?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PAVContainerNode@2@HH_N@Z, ?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PEAVContainerNode@2@HH_N@Z) 262 symbolWithPointer(?rectBasedTestResult@HitTestResult@WebCore@@QBEABV?$ListHashSet@V?$RefPtr@VNode@WebCore@@@WTF@@ $0BAA@U?$PtrHash@V?$RefPtr@VNode@WebCore@@@WTF@@@2@@WTF@@XZ, ?rectBasedTestResult@HitTestResult@WebCore@@QEBAAEBV?$ListHashSet@V?$RefPtr@VNode@WebCore@@@WTF@@$0BAA@U?$PtrHash@V?$RefPtr@VNode@WebCore@@@WTF@@@2@@WTF@@XZ)262 symbolWithPointer(?rectBasedTestResult@HitTestResult@WebCore@@QBEABV?$ListHashSet@V?$RefPtr@VNode@WebCore@@@WTF@@U?$PtrHash@V?$RefPtr@VNode@WebCore@@@WTF@@@2@@WTF@@XZ, ) 263 263 symbolWithPointer(?rectForPoint@HitTestLocation@WebCore@@SA?AVIntRect@2@ABVLayoutPoint@2@IIII@Z, ?rectForPoint@HitTestLocation@WebCore@@SA?AVIntRect@2@AEBVLayoutPoint@2@IIII@Z) 264 264 symbolWithPointer(?reload@FrameLoader@WebCore@@QAEX_N@Z, ?reload@FrameLoader@WebCore@@QEAAX_N@Z) -
trunk/Source/WebKit2/ChangeLog
r176289 r176290 1 2014-11-18 Geoffrey Garen <ggaren@apple.com> 2 3 Removed the custom allocator for ListHashSet nodes 4 https://bugs.webkit.org/show_bug.cgi?id=138841 5 6 Reviewed by Andreas Kling. 7 8 Uses of ListHashSet no longer need to declare an inline capacity, 9 since that was only used to specify the capacity of the custom allocator. 10 11 * UIProcess/Plugins/PluginInfoStore.cpp: 12 (WebKit::PluginInfoStore::loadPluginsIfNecessary): 13 1 14 2014-11-18 Eric Carlson <eric.carlson@apple.com> 2 15 -
trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
r173364 r176290 69 69 return; 70 70 71 ListHashSet<String , 32> uniquePluginPaths;71 ListHashSet<String> uniquePluginPaths; 72 72 73 73 // First, load plug-ins from the additional plug-ins directories specified.
Note:
See TracChangeset
for help on using the changeset viewer.