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

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

Issue 2652923002: Devirtualize Visitor and remove inline visitor specialization. (Closed)
Patch Set: Created 3 years, 11 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
Index: third_party/WebKit/Source/platform/heap/Heap.h
diff --git a/third_party/WebKit/Source/platform/heap/Heap.h b/third_party/WebKit/Source/platform/heap/Heap.h
index c494896d1b5fdc554e716e892a6a87744a4a3729..909da86c9a6b15d03f4b911230e2e1dd9939f71b 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.h
+++ b/third_party/WebKit/Source/platform/heap/Heap.h
@@ -435,6 +435,9 @@ class PLATFORM_EXPORT ThreadHeap {
// Conservatively checks whether an address is a pointer in any of the
// thread heaps. If so marks the object pointed to as live.
Address checkAndMarkPointer(Visitor*, Address);
+#if DCHECK_IS_ON()
+ Address checkAndMarkPointer(Visitor*, Address, MarkedPointerCallback);
+#endif
size_t objectPayloadSizeForTesting();
@@ -692,9 +695,8 @@ Address ThreadHeap::reallocate(void* previous, size_t size) {
return address;
}
-template <typename Derived>
template <typename T>
-void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) {
+void Visitor::handleWeakCell(Visitor* self, void* object) {
T** cell = reinterpret_cast<T**>(object);
if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell))
*cell = nullptr;
@@ -702,4 +704,6 @@ void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) {
} // namespace blink
+#include "platform/heap/VisitorImpl.h"
haraken 2017/01/25 06:14:08 It looks weird to include a header file at the end
sof 2017/01/25 06:25:24 The inlines depend on definitions above, so anywhe
+
#endif // Heap_h

Powered by Google App Engine
This is Rietveld 408576698