| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef HeapAllocator_h | 5 #ifndef HeapAllocator_h |
| 6 #define HeapAllocator_h | 6 #define HeapAllocator_h |
| 7 | 7 |
| 8 #include "platform/heap/Heap.h" | 8 #include "platform/heap/Heap.h" |
| 9 #include "platform/heap/Persistent.h" | 9 #include "platform/heap/Persistent.h" |
| 10 #include "platform/heap/TraceTraits.h" | 10 #include "platform/heap/TraceTraits.h" |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 template <typename T> | 472 template <typename T> |
| 473 struct VectorTraits<blink::Member<T>> : VectorTraitsBase<blink::Member<T>> { | 473 struct VectorTraits<blink::Member<T>> : VectorTraitsBase<blink::Member<T>> { |
| 474 STATIC_ONLY(VectorTraits); | 474 STATIC_ONLY(VectorTraits); |
| 475 static const bool needsDestruction = false; | 475 static const bool needsDestruction = false; |
| 476 static const bool canInitializeWithMemset = true; | 476 static const bool canInitializeWithMemset = true; |
| 477 static const bool canClearUnusedSlotsWithMemset = true; | 477 static const bool canClearUnusedSlotsWithMemset = true; |
| 478 static const bool canMoveWithMemcpy = true; | 478 static const bool canMoveWithMemcpy = true; |
| 479 }; | 479 }; |
| 480 | 480 |
| 481 template <typename T> | 481 template <typename T> |
| 482 struct VectorTraits<blink::SameThreadCheckedMember<T>> |
| 483 : VectorTraitsBase<blink::SameThreadCheckedMember<T>> { |
| 484 STATIC_ONLY(VectorTraits); |
| 485 static const bool needsDestruction = false; |
| 486 static const bool canInitializeWithMemset = true; |
| 487 static const bool canClearUnusedSlotsWithMemset = true; |
| 488 static const bool canMoveWithMemcpy = true; |
| 489 static const bool canSwapUsingCopyOrMove = false; |
| 490 }; |
| 491 |
| 492 template <typename T> |
| 482 struct VectorTraits<blink::TraceWrapperMember<T>> | 493 struct VectorTraits<blink::TraceWrapperMember<T>> |
| 483 : VectorTraitsBase<blink::TraceWrapperMember<T>> { | 494 : VectorTraitsBase<blink::TraceWrapperMember<T>> { |
| 484 STATIC_ONLY(VectorTraits); | 495 STATIC_ONLY(VectorTraits); |
| 485 static const bool needsDestruction = false; | 496 static const bool needsDestruction = false; |
| 486 static const bool canInitializeWithMemset = true; | 497 static const bool canInitializeWithMemset = true; |
| 487 static const bool canClearUnusedSlotsWithMemset = true; | 498 static const bool canClearUnusedSlotsWithMemset = true; |
| 488 static const bool canMoveWithMemcpy = true; | 499 static const bool canMoveWithMemcpy = true; |
| 489 static const bool canSwapUsingCopyOrMove = false; | 500 static const bool canSwapUsingCopyOrMove = false; |
| 490 }; | 501 }; |
| 491 | 502 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 | 607 |
| 597 template <typename U> | 608 template <typename U> |
| 598 static void store(const U& value, blink::Member<T>& storage) { | 609 static void store(const U& value, blink::Member<T>& storage) { |
| 599 storage = value; | 610 storage = value; |
| 600 } | 611 } |
| 601 | 612 |
| 602 static PeekOutType peek(const blink::Member<T>& value) { return value; } | 613 static PeekOutType peek(const blink::Member<T>& value) { return value; } |
| 603 }; | 614 }; |
| 604 | 615 |
| 605 template <typename T> | 616 template <typename T> |
| 617 struct HashTraits<blink::SameThreadCheckedMember<T>> |
| 618 : SimpleClassHashTraits<blink::SameThreadCheckedMember<T>> { |
| 619 STATIC_ONLY(HashTraits); |
| 620 // FIXME: The distinction between PeekInType and PassInType is there for |
| 621 // the sake of the reference counting handles. When they are gone the two |
| 622 // types can be merged into PassInType. |
| 623 // FIXME: Implement proper const'ness for iterator types. Requires support |
| 624 // in the marking Visitor. |
| 625 using PeekInType = T*; |
| 626 using PassInType = T*; |
| 627 using IteratorGetType = blink::SameThreadCheckedMember<T>*; |
| 628 using IteratorConstGetType = const blink::SameThreadCheckedMember<T>*; |
| 629 using IteratorReferenceType = blink::SameThreadCheckedMember<T>&; |
| 630 using IteratorConstReferenceType = const blink::SameThreadCheckedMember<T>&; |
| 631 static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { |
| 632 return *x; |
| 633 } |
| 634 static IteratorConstReferenceType getToReferenceConstConversion( |
| 635 IteratorConstGetType x) { |
| 636 return *x; |
| 637 } |
| 638 |
| 639 using PeekOutType = T*; |
| 640 |
| 641 template <typename U> |
| 642 static void store(const U& value, |
| 643 blink::SameThreadCheckedMember<T>& storage) { |
| 644 storage = value; |
| 645 } |
| 646 |
| 647 static PeekOutType peek(const blink::SameThreadCheckedMember<T>& value) { |
| 648 return value; |
| 649 } |
| 650 |
| 651 static blink::SameThreadCheckedMember<T> emptyValue() { |
| 652 return blink::SameThreadCheckedMember<T>(nullptr, nullptr); |
| 653 } |
| 654 }; |
| 655 |
| 656 template <typename T> |
| 606 struct HashTraits<blink::TraceWrapperMember<T>> | 657 struct HashTraits<blink::TraceWrapperMember<T>> |
| 607 : SimpleClassHashTraits<blink::TraceWrapperMember<T>> { | 658 : SimpleClassHashTraits<blink::TraceWrapperMember<T>> { |
| 608 STATIC_ONLY(HashTraits); | 659 STATIC_ONLY(HashTraits); |
| 609 // FIXME: The distinction between PeekInType and PassInType is there for | 660 // FIXME: The distinction between PeekInType and PassInType is there for |
| 610 // the sake of the reference counting handles. When they are gone the two | 661 // the sake of the reference counting handles. When they are gone the two |
| 611 // types can be merged into PassInType. | 662 // types can be merged into PassInType. |
| 612 // FIXME: Implement proper const'ness for iterator types. Requires support | 663 // FIXME: Implement proper const'ness for iterator types. Requires support |
| 613 // in the marking Visitor. | 664 // in the marking Visitor. |
| 614 using PeekInType = T*; | 665 using PeekInType = T*; |
| 615 using PassInType = T*; | 666 using PassInType = T*; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 const blink::HeapHashCountedSet<Value, HashFunctions, Traits>& set, | 836 const blink::HeapHashCountedSet<Value, HashFunctions, Traits>& set, |
| 786 VectorType& vector) { | 837 VectorType& vector) { |
| 787 copyToVector(static_cast<const HashCountedSet<Value, HashFunctions, Traits, | 838 copyToVector(static_cast<const HashCountedSet<Value, HashFunctions, Traits, |
| 788 blink::HeapAllocator>&>(set), | 839 blink::HeapAllocator>&>(set), |
| 789 vector); | 840 vector); |
| 790 } | 841 } |
| 791 | 842 |
| 792 } // namespace WTF | 843 } // namespace WTF |
| 793 | 844 |
| 794 #endif | 845 #endif |
| OLD | NEW |