OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 // to be not reachable during the marking phase, but it has yet to be swept | 873 // to be not reachable during the marking phase, but it has yet to be swept |
874 // and finalized. The predicate returns false in all other cases. | 874 // and finalized. The predicate returns false in all other cases. |
875 // | 875 // |
876 // Holding a reference to an already-dead object is not a valid state | 876 // Holding a reference to an already-dead object is not a valid state |
877 // to be in; willObjectBeLazilySwept() has undefined behavior if passed | 877 // to be in; willObjectBeLazilySwept() has undefined behavior if passed |
878 // such a reference. | 878 // such a reference. |
879 template<typename T> | 879 template<typename T> |
880 static bool willObjectBeLazilySwept(const T* objectPointer) | 880 static bool willObjectBeLazilySwept(const T* objectPointer) |
881 { | 881 { |
882 static_assert(IsGarbageCollectedType<T>::value, "only objects deriving f
rom GarbageCollected can be used."); | 882 static_assert(IsGarbageCollectedType<T>::value, "only objects deriving f
rom GarbageCollected can be used."); |
883 #if ENABLE(OILPAN) | |
884 BasePage* page = pageFromObject(objectPointer); | 883 BasePage* page = pageFromObject(objectPointer); |
885 if (page->hasBeenSwept()) | 884 if (page->hasBeenSwept()) |
886 return false; | 885 return false; |
887 ASSERT(page->heap()->threadState()->isSweepingInProgress()); | 886 ASSERT(page->heap()->threadState()->isSweepingInProgress()); |
888 | 887 |
889 return !ObjectAliveTrait<T>::isHeapObjectAlive(s_markingVisitor, const_c
ast<T*>(objectPointer)); | 888 return !ObjectAliveTrait<T>::isHeapObjectAlive(s_markingVisitor, const_c
ast<T*>(objectPointer)); |
890 #else | |
891 // FIXME: remove when lazy sweeping is always on | |
892 // (cf. ThreadState::preSweep()). | |
893 return false; | |
894 #endif | |
895 } | 889 } |
896 | 890 |
897 // Push a trace callback on the marking stack. | 891 // Push a trace callback on the marking stack. |
898 static void pushTraceCallback(void* containerObject, TraceCallback); | 892 static void pushTraceCallback(void* containerObject, TraceCallback); |
899 | 893 |
900 // Push a trace callback on the post-marking callback stack. These | 894 // Push a trace callback on the post-marking callback stack. These |
901 // callbacks are called after normal marking (including ephemeron | 895 // callbacks are called after normal marking (including ephemeron |
902 // iteration). | 896 // iteration). |
903 static void pushPostMarkingCallback(void*, TraceCallback); | 897 static void pushPostMarkingCallback(void*, TraceCallback); |
904 | 898 |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 template<typename T, size_t i, typename U> | 1777 template<typename T, size_t i, typename U> |
1784 inline void swap(HeapListHashSet<T, i, U>& a, HeapListHashSet<T, i, U>& b) { a.s
wap(b); } | 1778 inline void swap(HeapListHashSet<T, i, U>& a, HeapListHashSet<T, i, U>& b) { a.s
wap(b); } |
1785 template<typename T, typename U, typename V> | 1779 template<typename T, typename U, typename V> |
1786 inline void swap(HeapLinkedHashSet<T, U, V>& a, HeapLinkedHashSet<T, U, V>& b) {
a.swap(b); } | 1780 inline void swap(HeapLinkedHashSet<T, U, V>& a, HeapLinkedHashSet<T, U, V>& b) {
a.swap(b); } |
1787 template<typename T, typename U, typename V> | 1781 template<typename T, typename U, typename V> |
1788 inline void swap(HeapHashCountedSet<T, U, V>& a, HeapHashCountedSet<T, U, V>& b)
{ a.swap(b); } | 1782 inline void swap(HeapHashCountedSet<T, U, V>& a, HeapHashCountedSet<T, U, V>& b)
{ a.swap(b); } |
1789 | 1783 |
1790 } // namespace blink | 1784 } // namespace blink |
1791 | 1785 |
1792 #endif // Heap_h | 1786 #endif // Heap_h |
OLD | NEW |