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

Unified Diff: Source/platform/heap/Heap.h

Issue 1146353002: Oilpan: insist on eager sweeping for some objects. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/LifecycleObserver.h ('k') | Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.h
diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h
index 12044af291ba0d0b25b49b2538bc3c76f609d2e4..3c2ab858a45c36e6f69100f8c6905db36b8afd73 100644
--- a/Source/platform/heap/Heap.h
+++ b/Source/platform/heap/Heap.h
@@ -1119,6 +1119,8 @@ public:
}
};
+// TODO(Oilpan): enable these macros when enabling lazy sweeping, non-Oilpan.
+#if ENABLE(OILPAN)
#define EAGERLY_SWEEP(TYPE) \
template<typename T> \
class HeapIndexTrait<T, typename WTF::EnableIf<WTF::IsSubclass<T, TYPE>::value>::Type> { \
@@ -1129,6 +1131,35 @@ public: \
} \
}
+#define EAGERLY_SWEEP_TEMPLATE(TYPE) \
+template<typename T> \
+class HeapIndexTrait<T, typename WTF::EnableIf<WTF::IsSubclassOfTemplate<T, TYPE>::value>::Type> { \
+public: \
+ static int heapIndexForObject(size_t) \
+ { \
+ return EagerSweepHeapIndex; \
+ } \
+}
+
+// Overlapping and ambiguous specializations may happen
+// for Blink's DOMWindowProperty -- provide a convenience
haraken 2015/05/21 11:45:39 Just to confirm: If we write: EAGERLY_SWEEP_TEM
sof 2015/05/21 11:47:50 Correct.
haraken 2015/05/21 13:23:24 Makes sense. I'm OK with this but would slightly
+// macro which lifts the disambiguation to the EnableIf<>
+// predicate.
+#define EAGERLY_SWEEP_IF_NOT(TYPE, INSTANCE_OF) \
+template<typename T> \
+class HeapIndexTrait<T, typename WTF::EnableIf<!WTF::IsSubclassOfTemplate<T, INSTANCE_OF>::value && WTF::IsSubclass<T, TYPE>::value>::Type> { \
+public: \
+ static int heapIndexForObject(size_t) \
+ { \
+ return EagerSweepHeapIndex; \
+ } \
+}
+#else
+#define EAGERLY_SWEEP(TYPE)
+#define EAGERLY_SWEEP_TEMPLATE(TYPE)
+#define EAGERLY_SWEEP_IF_NOT(TYPE, COND)
+#endif
+
NO_SANITIZE_ADDRESS inline
size_t HeapObjectHeader::size() const
{
« no previous file with comments | « Source/platform/LifecycleObserver.h ('k') | Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698