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 |
{ |