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

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

Issue 2652923002: Devirtualize Visitor and remove inline visitor specialization. (Closed)
Patch Set: rebased 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/HeapPage.h
diff --git a/third_party/WebKit/Source/platform/heap/HeapPage.h b/third_party/WebKit/Source/platform/heap/HeapPage.h
index c401c9ef6d5fa72d66501e6c52b82349992c73b2..233d8de17c9cb4174737b57a8ccbdaa53ae04d81 100644
--- a/third_party/WebKit/Source/platform/heap/HeapPage.h
+++ b/third_party/WebKit/Source/platform/heap/HeapPage.h
@@ -354,6 +354,13 @@ inline bool isPageHeaderAddress(Address address) {
return !((reinterpret_cast<uintptr_t>(address) & blinkPageOffsetMask) -
blinkGuardPageSize);
}
+
+// Callback used for unit testing the marking of conservative pointers
+// (checkAndMarkPointer().) For each pointer that has been discovered
+// to point to a heap object, the callback is invoked with a pointer
+// to its header. If the callback returns |true|, the object will not
+// be marked.
+using MarkedPointerCallbackForTesting = bool (*)(HeapObjectHeader*);
#endif
// BasePage is a base class for NormalPage and LargeObjectPage.
@@ -408,6 +415,11 @@ class BasePage {
// conservatively mark all objects that could be referenced from
// the stack.
virtual void checkAndMarkPointer(Visitor*, Address) = 0;
+#if DCHECK_IS_ON()
+ virtual void checkAndMarkPointer(Visitor*,
+ Address,
+ MarkedPointerCallbackForTesting) = 0;
+#endif
virtual void markOrphaned();
class HeapSnapshotInfo {
@@ -489,6 +501,11 @@ class NormalPage final : public BasePage {
void poisonUnmarkedObjects() override;
#endif
void checkAndMarkPointer(Visitor*, Address) override;
+#if DCHECK_IS_ON()
+ void checkAndMarkPointer(Visitor*,
+ Address,
+ MarkedPointerCallbackForTesting) override;
+#endif
void markOrphaned() override;
void takeSnapshot(base::trace_event::MemoryAllocatorDump*,
@@ -567,6 +584,11 @@ class LargeObjectPage final : public BasePage {
void poisonUnmarkedObjects() override;
#endif
void checkAndMarkPointer(Visitor*, Address) override;
+#if DCHECK_IS_ON()
+ void checkAndMarkPointer(Visitor*,
+ Address,
+ MarkedPointerCallbackForTesting) override;
+#endif
void markOrphaned() override;
void takeSnapshot(base::trace_event::MemoryAllocatorDump*,
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.cpp ('k') | third_party/WebKit/Source/platform/heap/HeapPage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698