Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: Source/platform/heap/Heap.h

Issue 1133563004: Revert of Oilpan: Enable lazy sweeping on non-oilpan builds (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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)
883 BasePage* page = pageFromObject(objectPointer); 884 BasePage* page = pageFromObject(objectPointer);
884 if (page->hasBeenSwept()) 885 if (page->hasBeenSwept())
885 return false; 886 return false;
886 ASSERT(page->heap()->threadState()->isSweepingInProgress()); 887 ASSERT(page->heap()->threadState()->isSweepingInProgress());
887 888
888 return !ObjectAliveTrait<T>::isHeapObjectAlive(s_markingVisitor, const_c ast<T*>(objectPointer)); 889 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
889 } 895 }
890 896
891 // Push a trace callback on the marking stack. 897 // Push a trace callback on the marking stack.
892 static void pushTraceCallback(void* containerObject, TraceCallback); 898 static void pushTraceCallback(void* containerObject, TraceCallback);
893 899
894 // Push a trace callback on the post-marking callback stack. These 900 // Push a trace callback on the post-marking callback stack. These
895 // callbacks are called after normal marking (including ephemeron 901 // callbacks are called after normal marking (including ephemeron
896 // iteration). 902 // iteration).
897 static void pushPostMarkingCallback(void*, TraceCallback); 903 static void pushPostMarkingCallback(void*, TraceCallback);
898 904
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
1777 template<typename T, size_t i, typename U> 1783 template<typename T, size_t i, typename U>
1778 inline void swap(HeapListHashSet<T, i, U>& a, HeapListHashSet<T, i, U>& b) { a.s wap(b); } 1784 inline void swap(HeapListHashSet<T, i, U>& a, HeapListHashSet<T, i, U>& b) { a.s wap(b); }
1779 template<typename T, typename U, typename V> 1785 template<typename T, typename U, typename V>
1780 inline void swap(HeapLinkedHashSet<T, U, V>& a, HeapLinkedHashSet<T, U, V>& b) { a.swap(b); } 1786 inline void swap(HeapLinkedHashSet<T, U, V>& a, HeapLinkedHashSet<T, U, V>& b) { a.swap(b); }
1781 template<typename T, typename U, typename V> 1787 template<typename T, typename U, typename V>
1782 inline void swap(HeapHashCountedSet<T, U, V>& a, HeapHashCountedSet<T, U, V>& b) { a.swap(b); } 1788 inline void swap(HeapHashCountedSet<T, U, V>& a, HeapHashCountedSet<T, U, V>& b) { a.swap(b); }
1783 1789
1784 } // namespace blink 1790 } // namespace blink
1785 1791
1786 #endif // Heap_h 1792 #endif // Heap_h
OLDNEW
« no previous file with comments | « no previous file | Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698